我们不能在angularjs中使用带轨道的过滤器吗?如果我们能够解决这个问题背后的问题。请在这里找到小提琴http://jsfiddle.net/Tc34P/34/
<div ng-controller="Ctrl">
<p ng-init='dd=[{"a":["abcd"]},{"n":["efrg","efgh"]},{"z":["zela"]},{"p":["mithun","mithun","mithun"]}]'></p>
<input type="text" ng-model="x">
<div ng-repeat="cc in dd">
<div ng-repeat="(v,s) in cc ">
{{v}}
<div ng-repeat ="c in s track by $index | filter:x">
{{c}}
</div>
<div>
</div>
答案 0 :(得分:4)
您只需要将track by
表达式放在最后:
ng-repeat="c in s | filter:x track by $index"