Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@josee9988/filter-pipe-ngx

Josee998837MIT1.1.0TypeScript support: included

Angular universal pipe to filter arrays of objects. Ignores accent marks and upper/lowercase characters.

angular, universal, ngx, filter, pipe, angular8, angular9, angularx, ng2, case sensitive, accent mark, array, objects, filtering

readme

FilterPipeNgx for angular universal

Simple angular pipe that allows you to filter arrays of objects and simple arrays by a given text.

This angular universal filter pipe is able to filter by any field in your array of objects and can even ignore the accent marks or upercase/lowercase text.

Originally filter pipe based on solodynamo/ng2-search-filter, please do check his project.

Version Downloads License Vulnerabilities npm bundle size (scoped version) Node.js CI


Installation

  1. Install the pipe to your project.

     npm i @josee9988/filter-pipe-ngx --save
  2. Import the pipe to your app.module.ts.

     import {FilterModule} from '@josee9988/filter-pipe-ngx';
  3. Declare and initialize the pipe to your project.

     // rest of your imports here...
    
     @NgModule({
       imports: [ // in the imports section
         FilterModule, // add the pipe to your declarations
         // rest of the code ...

Examples of use

example of other web

Example of other integration in another web.

Stackblitz example

example of stackblitz

Check the stackblitz example or simply click the above image!

Direct component example

import {Component} from '@angular/core';

@Component({
  selector: 'app-example-filter-pipe-products',
  template: `
<!-- Input in which you will filter your products (you array) -->
<input type="text" [(ngModel)]="searchText">

<!-- Display your data and filter it by your input -->
<div *ngFor = "let arrayItem of yourArrayToBeFiltered | filterPipe:searchText">

    <!-- Every object that matches the filter (if there is any filter) will be shown -->
  <p>Name: {{arrayItem.name}}, Inventory: {{arrayItem.inventory}}, price: {{arrayItem.price}}</p>

</div>`
})

export class ExampleFilterPipeProducts {
  yourArrayToBeFiltered: any[] = [
   {name: 'chair', inventory: 5, price: 45.99},
   {name: 'table', inventory: 10, price: 123.75},
   {name: 'sofa', inventory: 2, price: 399.50},
   {name: 'bed', inventory: 4, price: 592.12}];
  searchText: string;
}

For deeper information about angular pipes check the oficial documentation.


Contributing

This project is actively looking for new contributors to develop new functions, maintain and improve the project. If you are interested make sure to fork the project and pull-request your improvements to be added as a contributor!


Did you enjoyed the package? Help us raise these numbers!

Github followers Github stars Github watchers Github forks

Check the npm page with the package.


Made with a lot of ❤️❤️ by @Josee9988

changelog

Change Log 📜📝

All notable changes to the "FilterPipeNgx" angular pipe for filtering arrays of objects will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.


[1.1.0] - 2020-05-22

Added

  • CI github tests on PR and push to master.
  • CI github badge in the README.md file.
  • @types/jasmine in the dev dependencies.

Changed

  • From angular 8.x to 9.x.
  • Contributing section in the README.md file.

Fixed

  • npm scripts from packagr to build.

[1.0.3] - 2020-05-02

Added

  • Some badges to the README.md file.

Fixed

  • Problem with the dependencies that made the test not run anymore.

[1.0.2] - 2020-05-01

Changed

  • README.md location of the ngmodule (from declarations to imports).
  • Class will be imported from 'FilterPipe' to 'FilterModule' to avoid build to production errors.

[1.0.1] - 2020-05-01

Added

  • Some extra gifs in the README.md file.

[1.0.0] - 2020-05-01

Added

  • Stackblitz example in the README.md file.

[1.0.0-beta.1] - 2020-05-01

Added

  • lodash.deburr as an internal dependency.

[1.0.0-beta.0] - 2020-05-01

Added

  • The pipe is working, and the tests are running.
  • Published to npmjs.com as a beta to test it out in other projects.