get element count with a few parameters angularjs -
i want filter elements using angular's filter check on 2 attributes , number of returned elements
this have tried:
$scope.countpriorityactive = true; $scope.getcountactive = function(strcat) { return filterfilteractive($scope.tasks, {priority: strcat, active: true}).length; };
but it's not working
have started editing example: http://plnkr.co/edit/8ybrtd?p=preview
what's mistake?
you forgot add "active" attribute in elements of array
{ id: 1, name: 'iron man', fname: 'tony', lname: 'stark', location: 'stark tower', comic: 'marvel' active: true //this need add each element },
also need call "filterfilter", not "filterfilteractive" unless made new filter yourself
Comments
Post a Comment