Package Exports
- ngx-pipe-search-by
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ngx-pipe-search-by) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
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 --saveUsage
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>