src/app/manage-learn/shared/pipe/entity-local-search.ts
Name | entitySearch |
transform |
transform(value: any, args?: any)
|
Returns :
any
|
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'entitySearch',
})
export class EntitySearchPipe implements PipeTransform {
transform(value: any, args?: any): any {
if (!value) return null;
if (!args) return value;
args = args.toLowerCase();
return value.filter(function (item) {
return JSON.stringify(item).toLowerCase().includes(args);
});
}
}