Is it possible to use an Angular filter to compare values with each value from an array?
Categories: <span ng-repeat="c in i.categories | filter: '!'+'myArray' ">{{c}}</span>
I would like to display values from i.categoriesthat are not in myArray:
$scope.i = {
categories: [
"Europe & Eurasia",
"Featured",
"Headlines",
"Middle East",
"News",
"NEWS BY TOPIC",
"News Categories",
"REGIONAL NEWS"
]
};
$scope.myArray = ['Featured', 'Headlines', 'News'];
I want to get everything from cthat which is not contained in myArray.
I tried to write some functions, but I get my application very slow due to the large number of requests.
So, can I somehow pass my array, and let Angular go through each element in this array and compare it with the current value?
source
share