I am facing an issue where I am attempting to color some of the items in a list using Ionic framework. The array named somearray
contains the indices that need to be colored red. However, no matter what I do, only the first index in the array is being colored. Can you help me identify the problem in the code below?
<ion-list>
<ion-item ng-class="{red : !somearray.indexOf($index)}" ng-repeat="todo in todos" class="item">
<div>
<button class="button button-block button-dark" ng-click="addNewForm($index)">
{{todo.title}}
</button>
</div>
</ion-item>
</ion-list>