我有一个有点像下面提到的集合: -
[ { rootGroup: "group1", secondGroup: false, items: [ {name:"Ram"}, {name:"Mohan"}, {name:"Shyam"}, ] }, { rootGroup: "group2", secondGroup: true, secondLevelGroups:[ { group: "gp1" items: [ {name:"Ganesh"}, {name:"Sita"}, {name:"Gita"}, ] }, { group: "gp2" items: [ {name:"Soham"}, {name:"Vikas"}, {name:"Ashish"}, ] } ] } ]
现在我想过滤名字。因此,例如,如果过滤器值为" am" ,则输出应如下所示。
[ { rootGroup: "group1", secondGroup: false, items: [ {name:"Ram"},` {name:"Shyam"}, ] }, { rootGroup: "group2", secondGroup: true, secondLevelGroups:[ { group: "gp2" items: [ {name:"Soham"}, ] } ] } ]
我想使用angularjs过滤器