大家好我如何过滤angularjs中的值?如何过滤angularjs中的值?
我已经创建了plunker供参考: - My Plunker。
我想过滤的NG-重复
user
categories
question list page
用户DATAS: -
"user": {
"_id": "58072aba0f82a61823c434df",
"displayName": "Table 1",
"dob": "2016-12-22T18:30:00.000Z",
"location": "chennai",
"religion": "hindu",
"roles": [
"admin"
],
"profileImageURL": "./modules/users/client/img/profile/uploads/ac4fbab396c2f725ed5211524f171136"
},
categories
值是数组,我需要过滤categories
只有在ng-repeat list页面中才有值....例如: - 如果
user categories values
"categories": [ "Religion & Culture", "Social Psychology" ],
所以这两个值应该只类的列表进行过滤,...
我的HTML: -
<div ng-repeat="question in questions | filter:user.categories ">
<small>
<span >{{$index + 1}}.</span>
<span data-ng-bind="question.category"></span>
</small>
</div>
我在ng-repeat中使用过滤器,如: -
| filter:user.categories
我要筛选在重复列表中的用户类别...
请检查和更新plunker也知道确切的解决方案......
你想过滤你的清单?你需要有一些关于“类别”的数据我猜? – tanmay
这只是一项功课吗?在这里发帖之前你有什么尝试? – Pengyy
@tanmay请看我的plunker我有类似的用户数据,我需要在ng-repeat列表中筛选这些类别,请检查我的plunker并更新相同的...谢谢..... –