Answer the question
In order to leave comments, you need to log in
How to filter objects in Angular on click?
Hi, I just started learning Angular and I have this question...
there is a filtering menu that looks like this
2010 2011 2012 2013 2014 All time
All projects Website Mobile apps Games
if(obj.tags.indexOf('games')>=0)
Answer the question
In order to leave comments, you need to log in
That buttons were formed automatically from existing years, you can use the groupBy filter:
The same goes for the buttons for the type (games, etc.):
Then, when displaying your information, use the filters currentYear and currentType
<div ng-repeat="element in data | filter:{year:currentYear,type:currentType}">...</div>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question