aurelia-router-metadata
Version:
Adds decorator configuration with conventions and eager loading capabilities to aurelia-router
14 lines (12 loc) • 352 B
text/typescript
// tslint:disable:no-implicit-dependencies
import { valueConverter } from "aurelia-binding";
("filter")
export class Filter {
public toView(arr: any[], prop: string, value: any): any[] {
if (arr && arr.length && prop && value) {
return arr.filter((a: any) => (a[prop] === value));
} else {
return arr;
}
}
}