I have a JS array of objects.
$scope.users = [{
"name": "alice",
"city": "london",
"wards": [{
"id": 1,
"number": 24
},
{
"id": 2,
"number": 25
},
{
"id": 3,
"number": 26
}
]
},
{
"name": "bob",
"city": "london",
"wards": [{
"id": 1,
"number": 24
},
{
"id": 2,
"number": 25
},
{
"id": 4,
"number": 27
}
]
}
]
I have a ng-repeat="user in users | filter: searchUser
Here searchUser
can contain name, city and ward number.
Now the search is working fine for name and city but not for the sub array of objects wards to search for ward number.
Is there an angularJS way with which I could achieve this?