我想使用过滤器列出特定键内的项目。现在列出这样的。
我希望这样使用过滤器
function testCtrl($scope) {
$scope.items = {"id":"B716","day":8,"di":{"type":"normal","one":[{"name":"Sanal","age":"18"},{"name":"Jin","age":"25"}],"two":[{"name":"Jeff","age":"55"},{"name":"Sam","age":"32"}],"three":[{"name":"John","age":"34"},{"name":"Tim","age":"39"}]}};
}
<div ng-app="" ng-controller="testCtrl">
<ul>
<li ng-repeat="val in items.di">
<ul>
<li ng-repeat="value in val">{{value.name}}</li>
</ul>
</li>
</ul>
</div>
答案 0 :(得分:0)
在您的ng重复中将其更改为
<li ng-repeat="value in val | filter: val.name='jeff'">{{value.name}}</li>
我使用了名称,您可以使用您想要的值进行测试