I want to filter the objects where the object structure is a little complex. I am looking a kind of deep filtering, where angular $filter works on the elements inside the array:
[
{
"schoolId": 12345,
"schoolName": "ZXCVB",
"classes": [
{
"classId": "C1",
"students": 50
},
{
"classId": "C2",
"students": 100
}
]
},
{
"schoolId": 98765,
"schoolName": "QWERTY",
"classes": [
{
"classId": "C1",
"students": 100
},
{
"classId": "C2",
"students": 50
}
]
}
]
(This is an array of schools. Each school has array of classes and classes has Ids)
Here the thing I am looking for help is how can I filter on classId, so that it returns me the school object.