File

src/app/manage-learn/shared/pipe/entity-local-search.ts

Metadata

Methods

transform
transform(value: any, args?: any)
Parameters :
Name Type Optional
value any No
args any Yes
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);
    });
  }
}

results matching ""

    No results matching ""