我一直在寻找解决方案,但找不到确切的场景。我想知道有人可以帮忙。我已经NG-重复筛选器列表如下:AngularJS:在ng-model上搜索多个值
<ul>
<li ng-repeat="f in filterOptions">
<p>{{f.group}}</p>
<ul>
<li ng-repeat="o in f.options">
<input id="{{$parent.f.filtername}}{{$index}}" type="checkbox" ng-model="Filter.category[o.title]" ng-true-value="{{o.title}}" ng-false-value="" />
</li>
</ul>
</li>
</ul>
我的JSON:
[
{
"group": "Product Categories",
"filtername" : "category",
"options": [
{
"title": "Category A",
"alt_titles": ["Category B, Category C"]
},
{
"title": "Category 1",
"alt_titles": ["Category 2, Category 3"]
}
]
}
]
有了这个,我可以成功地寻找属于o.titles项目。现在,我想知道我该怎么做才能搜索也属于alt_titles的项目。
例如:如果我点击A类,它也将B类和C类。同样的,第1类循环项目,它应该显示在第2类和3
我希望我是清楚的项目。请帮忙。谢谢!
工作样本FIDDLE
你能帮我一个jsfiddle或plunker的例子吗?谢谢 – GianArb 2015-03-30 22:49:38
可能的重复http://stackoverflow.com/questions/13216115/filtering-by-multiple-specific-model-properties-in-angularjs-in-or-关系和类似的问题。 – orbitbot 2015-03-30 23:22:09
@GianArb我在上面加了一个小提琴。 – Jon 2015-03-31 07:20:29