Hi everyone how can i filter the values in angularjs?
I have created plunker for reference :- My Plunker.
I want to filter
user
categories
in ng-repeatquestion list page
User 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
values are in array, i need to filtercategories
values only in ng-repeat list page....For Example:- if
user categories values
"categories": [ "Religion & Culture", "Social Psychology" ],
so these two values only should filter in list of category...
My Html:-
<div ng-repeat="question in questions | filter:user.categories ">
<small>
<span >{{$index + 1}}.</span>
<span data-ng-bind="question.category"></span>
</small>
</div>
I have used filter in ng-repeat like :-
| filter:user.categories
I want to filter user categories in repeat list...
please check and update the plunker as well to know the exact solution...