我有这样的角度嵌套对象。有没有办法为嵌套属性过滤它
<li ng-repeat="shop in shops | filter:search">
search.locations.city_id = 22
我只显示父元素,但想同时过滤它,例如:
search =
category_id: 2
locations:
city_id: 368
[
name: "xxx"
category_id: 1
locations: [
city_id: 368
region_id: 4
,
city_id: 368
region_id: 4
,
city_id: 368
region_id: 4
]
,
name: "xxx"
category_id: 2
locations: [
city_id: 30
region_id: 4
,
city_id: 22
region_id: 2
]
]