UPDATE: I realized that by closely examining the documentation, it is possible to utilize the filter filter using a specific syntax (refer to this fiddle) in order to filter based on object properties:
<tr ng-repeat="user in users | filter:{status:4}">
Here is my original response for reference:
When using the filter filter, it may not be possible to directly pass a parameter. However, there are two alternative approaches you can consider.
1) Assign the desired filtering data to a scope variable and access it within your filter function as demonstrated in this fiddle.
JavaScript:
$scope.status = 1;
$scope.users = [{name: 'first user', status: 1},
{name: 'second user', status: 2},
{name: 'third user', status: 3}];
$scope.isStatus = function(user){
return (user.status == $scope.status);
};
Html:
<li ng-repeat="user in users | filter:isStatus">
OR
2) Implement a custom filter that accepts a parameter like illustrated in this fiddle.
JavaScript:
var myApp = angular.module('myApp', []);
myApp.filter('isStatus', function() {
return function(input, status) {
var out = [];
for (var i = 0; i < input.length; i++){
if(input[i].status == status)
out.push(input[i]);
}
return out;
};
});
Html:
<li ng-repeat="user in users | isStatus:3">
Please note that this particular filter assumes the presence of a status
property in the objects within the array, potentially limiting its reusability. This example serves as an illustration, and further information on creating filters can be found here.