I need to use either a filter or another, how to do?
<tr ng-repeat="currentCollectionItem in binding
| filter: ({ isPending: false } || {isPending: undefined})">
I need to use either a filter or another, how to do?
<tr ng-repeat="currentCollectionItem in binding
| filter: ({ isPending: false } || {isPending: undefined})">
On
Your best bet is to define a filter method on your controller/component class and use that instead.
This has two main advantages:
If you need help doing this, let me know.
On
Use a custom predicate function:
<tr ng-repeat="currentCollectionItem in binding | filter: notPendingFilterFn">
$scope.notPendingFilterFn = function(value, index, array) {
return value.isPending === false || value.isPending === undefined;
};
A predicate function can be used to write arbitrary filters. The function is called for each element of the array, with the element, its index, and the entire array itself as arguments.
For more information, see
Solution
You can do this using only one condition:
This is how you can apply false and undefined properties.
Example