Lets say you have an array that is rendered in a ul with an li for each element and a property on the controller called selectedIndex.
ul
li
selectedIndex
We can make a function to manage return class with condition
And then
AngularJS ng-class if example {{icolor}} Other way using : ng-class="{'class1' : expression1, 'class2' : expression2,'class3':expression2,...}" {{icolor}}
{{icolor}}
Other way using : ng-class="{'class1' : expression1, 'class2' : expression2,'class3':expression2,...}"
You can refer to full code page at ng-class if example