I have a list and I\'d like to set one item as class=\"active\" automatically. Given the following bootstrap code:
-
the active route's path is updated automatically in the ApplicationController via currentPath so I did something like that in my App...
In ApplicationController added properties like so:
isProductsActive: function(){
if ( this.get('currentPath') === 'products' ) return 'active';
else return '';
}.property('currentPath')
and in my ApplicationView template:
-
{{#linkTo "products"}}Products{{/linkTo}}