Currently, I am working with a JSON result that appears in an ng-repeat and I want to filter it based on separate data objects or arrays:
Controller.js
$scope.jsonResult = [
{
"id": "a123"
},
{
"id": "b456"
}
]
HTML
<span ng-repeat="r in jsonResult">{{r.id}}</span>
I am trying to create another array of information and then use this data to filter the results displayed in my HTML using ng-repeat.
$scope.itemsToFilter = ["b456","foo"]
When an item matches within my itemsToFilter array and my jsonResult scope object, I do not want it to display within the ng-repeat in my HTML. Do I need to create a custom filter for this? Apologies as I am just starting out with Angular.