repeat values based on another input ng-model value in angularjs?
I have one input value like Social Psychology
for this value ng-model is kpcategory
I have used ng-repeat like ng-repeat="question in questions
to list out the all category
and name
.
Social Psychology
category in ng-repeat
list, so i used like ng-repeat="question in questions | filter:kpcategory"
.Social Psychology
data's perfectly. but i would like to filter only the category value of Social Psychology
not for all data's. the issue is it's filtered includes of category and category_two
data's.Expecting result is:-
just want to filter by catgory
Social Psychology
so result should be Social Psychology , John
data.
we don't how to solve this issue please help us thanks.
You can try following to filter items by category property only
<div ng-repeat="question in questions | filter:{ category: kpcategory }">
<ul>
<li><span>{{question.category}} , {{question.name}}</span></li>
</ul>
</div>