So I want to check for multiple values in array of objects with $filter from angular. You can find my code below.
angular.module('app', [])
function ParentCtrl($scope, $filter){
var list = [{name : "test", value : "test"}, {name: "test1", value: "test"}, { name: 'test', value: 'test1'}];
var newTemp = $filter("filter")(lst, {name:'test'});
console.log(newTemp);
}
So what I want is in newTemp to have all objects that have name=test or value=test. With code above I am getting all objects that have name=test. So how can i add one more condition??
I tried also with
var newTemp = $filter("filter")(lst, {name:'test'}) || $filter("filter")(lst, {value:'test'});
but no success.