bia-framework
Version:
Bia Framework to work with angular 2
23 lines (18 loc) • 412 B
text/typescript
/**
* Created by jd on 13/01/2016.
*/
import {Pipe, PipeTransform} from "@angular/core";
({
name: 'search'
})
export class SearchPipe implements PipeTransform
{
public transform(value:Array<any>, args:any[]):any
{
let [property,argValue] = args;
return value.filter(item =>
{
return item[property] == argValue;
});
}
}