src/app/manage-learn/shared/pipe/search.pipe.ts
Name | search |
transform |
transform(value: any, args?: any)
|
Returns :
any
|
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'search',
})
export class SearchPipe 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);
});
}
}