1.0.0 • Published 5 years ago

ngx-pipe-search-by v1.0.0

Weekly downloads
3
License
GPLV3
Repository
github
Last release
5 years ago

ngx-pipe-search-by

Search in array of object by property

Arguments

ParamTypeDefaultDetails
collectionArray-The collection to filter
searchWordstring-String to search
propertiesSearchArray<string>-Property to look for. Examples: [name], [name, client.name, client.pet.name]
sensitivebooleantrueCase sensitive

Install

npm install ngx-pipe-search-by --save

Usage

Import PipeSearchByModule to your module

import { NgModule } from "@angular/core";
import { BrowserModule } from "@angular/platform-browser";
import { AppComponent } from "./app";

import { PipeSearchByModule } from "ngx-pipe-search-by";

@NgModule({
  imports: [BrowserModule, PipeSearchByModule],
  declarations: [AppComponent],
  bootstrap: [AppComponent]
})
export class AppModule {}

In HTML Template

<div
  *ngFor="let item of collection | searchBy: searchWord: propertiesSearch: sensitive"
>
  <!-- HERE HTML -->
</div>