function call in ng-class attribute of ng-repeat directive

Viewed 178

Can someone figure out the problem with following line of code.

<tr ng-repeat="myrecord in myData" 
  ng-class="togglecolor('{{myrecord.name}}','{{myrecord[$index-1].name}}')? 'yellow':'red'">

Here togglecolor() function returns true or false. yellow and red color not getting applied to the row.

2 Answers
Related