src/app/shared/pipes/search-filter.pipe.ts
name | searchFilter |
pure | false |
transform |
transform(items: any, term: any)
|
Defined in src/app/shared/pipes/search-filter.pipe.ts:9
|
Returns :
any
|
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'searchFilter',
pure: false
})
export class SearchfilterPipe implements PipeTransform {
transform(items: any, term: any): any {
if (term === undefined) {
return items;
}
return items.filter(function(item) {
for (const property in item) {
if (item[property] === null) {
continue;
}
if (item[property].toString().toLowerCase().includes(term.toLowerCase())) {
return true;
}
}
return false;
});
}
}