I have the following anchor tag:
<a href="#/home" ng-class="{ active: navCtrl.checkCurrent('home')" ng-click="navCtrl.setLink('home')" class="navigation-anchor">Home</a>
I have confirmed by manually adding active to the class attribute of this anchor that my class produces the intended result. I have also confirmed that nav.Ctrl.checkCurrent('home') evaluates to true when I've clicked this link.
However, that being said...this directive fails to produce the results I'm looking for.
The intended function is that when the function is true, the active class will be applied to my anchor tag.
Since I have checked that the class works, and the function produces the correct boolean operator, I must have the syntax for ng-class incorrect. However, I recently completed a tutorial on Code School dealing with Angular JS and they use the following syntax...
ng-class="{ active: tab.isSet(1) }"
...in an anchor tag. When the function tab.isSet(1) evaluates to true the class is applied to the element.
Why is my equal syntax not producing the same result?