Reputation: 213
I have an AngularJs table
<tr ng-repeat="data in blankettInfoData">
<td>{{data.informationstyp}}</td>
<td>{{data.rubricering}}</td>
<td>{{data.dokumenttyp}}</td>
<td><input type="checkbox" ng-model="data.checked"/></td>
</tr>
Now I want to change the color of one row when this happens:
Please help me
Upvotes: 0
Views: 4234
Reputation: 6620
You can use angular directive ng-class
for this
HTML:
<tr ng-repeat="data in blankettInfoData" ng-class="{'green': data.informationstyp == 'ABC123', 'red': data.checked == true}">
<td>{{data.informationstyp}}</td>
<td>{{data.rubricering}}</td>
<td>{{data.dokumenttyp}}</td>
<td><input type="checkbox" ng-model="data.checked"/></td>
</tr>
CSS:
.red{
color:red;
}
.green{
color:green;
}
Upvotes: 1