Is there any way to use an Angular filter to compare value with every value from an array?
Categories: <span ng-repeat="c in i.categories | filter: '!'+'myArray' ">{{c}}</span>
I would like to display values from i.categories
that 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 c
which is not contained in the myArray
.
I've tried with writing some functions, but I get my app really slow, because of a lot requests.
So, can I just somehow pass my array, and let Angular goes through every single item in that array and compare it with the current value?
i.categories
look like, just post it, is it a normal object or nested object or an array? – Microsporangium