问题描述:

This is what I did so far:

 fourHunderds = $filter('filter')($scope.filterErrors, {StatusCode:"404"}).length;

$scope.filterErrors has StatusCode property but it seems length of the $scope.filterErrors and fourHunders are always the same (filtering is not working, this line of code doesn't work for me)

网友答案:

Unless you are using a predefined angular filter you can do this with Array.prototype.filter()

fourHunderds = $scope.filterErrors.filter(function(item){
                   return item.StatusCode == '404';
               }).length
相关阅读:
Top