angularjs - How to pass multiple parameter in angular filter function, not custom filter -
i tried hard , visit lot of similar question still unable solve issue.
i want pass parameter in angular filter function. found solution below it's not working. getting undefined object have used in ng-repeat
.
<li ng-repeat="user in users | filter:isstatus(user,secondparam)">{{user.name}}</li>
there solution angular custom filter below not working angular filter function.
<li ng-repeat="user in users | filter:isstatus:user:secondparam">{{user.name}}</li>
jsfiddle - can see problem here.
will try:
$scope.isstatus = function(secondparam, thirdparam){ return function(user) { console.log(secondparam); console.log(thirdparam); return user.status == $scope.status; }
updated version http://jsfiddle.net/4pyza/282/
Comments
Post a Comment