0
我下面提到的集合有點像: -過濾器通過多級深物業
[ { 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過濾器做
張貼顯示JSON數據 –
檢查HTML代碼[這個蘇答案( http://stackoverflow.com/questions/41342285/how-to-hide-group-heading-when-child-elements-not-present-on-user-search/41342425#41342425) –
@NagaveerGowda html的內部部分與問題無關。只是外部是必需的。即使用fiter設置初始數據。我不知道如何在這種情況下使用過濾器 –