ngx-filter-pipe
Advanced tools
Changelog
2.1.2
Now $or
can filter with multiple predicates
class AppComponent {
objects = [{ name: 'John' }, { firstName: 'John' }];
constructor(private filter: FilterPipe) {
let result = this.filter.transform(this.objects, {
$or: [{ name: 'John' }, { firstName: 'John' }],
});
console.log(result); // [{ name: 'John' }, { firstName: 'John' }]
}
}
Changelog
2.0.0
Bundle location is changed, therefore SYSTEMJS config should be updated
Append to map
var map = {
...
'ngx-filter-pipe': 'node_modules/ngx-filter-pipe/bundles'
}
and then add to packages
var packages = {
...
'ngx-filter-pipe': { defaultExtension: 'js' }
}
Changelog
1.0.2
Inject FilterPipe
into your component and use it:
class AppComponent {
objects = [{ name: 'John' }, { name: 'Nick' }, { name: 'Jane' }];
constructor(private filter: FilterPipe) {
let result = this.filter.transform(this.objects, { name: 'J' });
console.log(result); // [{ name: 'John' }, { name: 'Jane' }]
}
}