I have an list as,
$scope.list1= [{"name":"name1","id":1},{"name":"name2","id":2},{"name":"name3","id":3},{"name":"name4","id":4}];
I want to filter this list with respect to another list as,
$scope.list2=[1,3];
Here I want filter list1 so that only those objects items are left ehich are in list2. i.e
after filter
$scope.list1= [{"name":"name1","id":1},{"name":"name3","id":3}];
I can do this by using the splice function . But I want to ask that whether this can be done using the $filter without using a loop.