ng-class condition changes, but not updating classes

Instead of

ng-class="{'active': {{selectedCat ==}}}"


ng-class="{active: selectedCat ==}"


ng-class="{'active': {{selectedCat ==}}}"


ng-class="{'active': selectedCat ==}"

You never need to nest those curly braces like that, in Angular.

Have a look at the ng-class documentation for some more examples.

Hi i'm also facing the same problem. i solved the problem by the way instead of assigning the value directly to ng-class, call the separate method and return the value.

ex :


$scope.getStyleClass = function(cat)  {   
      return "active: selectedCat ==";  

roughly i coded. please change the method as per your requirement.