When defining a custom filter in Angularjs like below I'm passing in the data set I want filtered and an array to serve as the filter values:
Toggle buttons state passed in an array

Parameter array value passed into the filter

How the filter is called:
<div class="row" ng-repeat="item in data | filterStats:filters">
The custom filter checks which values in the array should apply by filtering the data set in ng-repeat.
.filter('filterStats', function () {
return function (items, paramArray) {
var isFilterEmpty = true;
angular.forEach(paramArray, function (value, key) {
if (value == 0) {
isFilterEmpty = false;
}
});
if(!isFilterEmpty)
//More logic
}
}
Problem: The problem is that the array parameter does not seems to be able to loop using a forEach inside of the custom filter. The parameter array shows [Array[0]] therefore seems empty.
Can anyone please provide guidance on this matter? Can one pass an Array as a custom filter parameter? What am I missing?
Tx.