We are going to learn how to filter our bookmarks based on the selected category. We will learn how to manage the current category in the controller as well as set the current category from the view. As a bonus, we will see how to dynamically apply a class to visually indicate what category is the currently selected category.
The code for this lesson can be found on Github. note: the tags correspond to the lessons.
I stumbled upon the same problem.
There is no need to create an own filter-directive. This syntax worked for me.
<div ng-repeat="bookmark in bookmarks | filter:currentCategory.name">
Thanks, it solves the version issue :)
Hi - Could someone please explain what ng-class="{'active' ... is doing? ty
Yeah, I don't really understand what "active class" means either and how you are telling it to make the label stay highlighted. Maybe it is a css class in the eggly.css that we don't see?
How does the filter in ng-repeat manage to work when the currentCategory is set to null?
Hey Guys!
A silly question... How can I set a default category, my ideia is show for example a "development" category instead of the all bookmarks.
If some one can give a hand I will appreciate.
Cheers, Marcio