I'm trying to make multi filter, that filters three properties in object.
what I already did:
<div class="" ng-repeat="selectedCard in Cards | filter {
status:filterValueStatus,
monitorLevel:filterValueType,
monitorSystem:filterValue
} ">
The problem is that I need to show the object if status equals to '2' , and not continue to the two filtered properties : monitorLevel and monitorSystem that come after. (It doesn't work). Also I need to show the object if status equals to '3' , then filter it by the two properties monitorLevel and monitorSystem.
In summary it needs to check the status and only after , to decide whether to make the other two filters or not.
The filter I built until now :
app.filter('cardFilter', ['$filter', function($filter) {
return function(status, monitorLevel,monitorSystem) {
if (status == '2') {
return $filter('filter')(status);
} else {
return $filter('filter')(status,monitorLevel,monitorSystem);
}
};
}]);
the answer :
<div class="" ng-repeat="selectedCard in Cards | filter: filterValueStatus == '2' ? {status:'2'} : {status:'3', monitorLevel:filterValueLevel, monitorSystem:filterValue}">