I have a list which is limited to 3 items, the first item needs class blue1
, 2nd needs blue2
, 3rd blue3
.
<ul>
<li ng-repeat="tag in chartTags" class="blue-tag">
<div class="tag blue1" ng-class="{blue1: tag == 1 }">{{tag.term}}</div>
</li>
<!-- <li><div class="tag blue1">item1</div></li>
<li><div class="tag blue2">item2</div></li>
<li><div class="tag blue3">item3</div></li> -->
</ul>
Is there a way to write a check like
ng-class="{blue1: tag == 1 || blue2: tag == 2 || blue3: tag == 3 }"