Angularjs Filter On Multiple Values Of One Field
I need to be able to filter on two different values of one field of an object. Take the following example. $scope.products = [ {name:'Apple',type:'fruit'}, {name:'Grape',ty
Solution 1:
Use a filter function instead:
$scope.fruitOrVeg = function(product){
return product.type == 'fruit' || product.type == 'vegetable';
};
<li ng-repeat="item in products | filter:fruitOrVeg">{{item.name}}</li>
Post a Comment for "Angularjs Filter On Multiple Values Of One Field"