import * as _ from "lodash" ; import { Pipe , PipeTransform } from "@angular/core" ; @ Pipe ( { name : "dataFilter" } ) export class DataFilterPipe implements PipeTransform { transform ( array , query ) { if ( query ) { return _ . filter ( array , row => row . name . indexOf ( query ) > - 1 ) ; } return array ; } }