I have product array. I want to filter type key. I want to display only vegetables and fruits together. How to set filter on single key and multiple value in AngularJS.
<div ng-controller="MyCtrl">
<ul>
<li ng-repeat="item in products | filter:({type:'vegetable'}||{type:'fruit'})">{{item.name}}</li>
</ul>
</div>
var myApp = angular.module('myApp', []);
function MyCtrl($scope) {
$scope.products = [
{name:"Apple",type:"fruit"},
{name:"Grape",type:"fruit"},
{name:"Orage",type:"fruit"},
{name:"Carrot",type:"vegetable"},
{name:"Milk",type:"dairy"}
]
}