Trying to figure out how to highlight a table row using AngularJS within a directive. Here is some pseudo code I came up with:
if(highlight.indexOf($index) != -1) set .highlight css class
Below is an example of my code snippet:
$scope.highlight = [0,2,3]
.highlight {
color: red;
}
<table class="ui celled table">
<thead>
<tr>
<th>AAA</th>
<th>BBB</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="a in as track by $index"> <!-- The ng-class needs to be here, but where should i do the verification? -->
<td>{{a}}</td>
<td>{{b[$index]}}</td>
</tr>
</tbody>
</table>