ngx-pipe-search-by
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

ngx-pipe-search-by

Search in array of object by property

Arguments

Param Type Default Details
collection Array - The collection to filter
searchWord string - String to search
propertiesSearch Array<string> - Property to look for. Examples: [name], [name, client.name, client.pet.name]
sensitive boolean true Case 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>

Package Sidebar

Install

npm i ngx-pipe-search-by

Weekly Downloads

0

Version

1.0.0

License

GPLV3

Unpacked Size

137 kB

Total Files

24

Last publish

Collaborators

  • mikeg96