AngularJS ng-class-evenDirective
AngularJS Examples
Set class="striped" for even rows of the table:
<table ng-controller="myCtrl">
<tr ng-repeat="x in records" ng-class-even="'striped'">
<td>{{x.Name}}</td>
<td>{{x.Country}}</td>
</tr>
</table>
<tr ng-repeat="x in records" ng-class-even="'striped'">
<td>{{x.Name}}</td>
<td>{{x.Country}}</td>
</tr>
</table>
Try it Yourself »
Definition and Usage
ng-class-evenThe directive is used to dynamically bind one or more CSS classes to HTML elements, but it only applies to even rows.
ng-class-evenDirective needs to be used withng-repeatUsed in conjunction with the instruction.
ng-class-evenThe directive is recommended for use in table style rendering, but all HTML elements are supported.
Syntax
<element ng-class-even="expression"></element>
All HTML elements are supported.
Parameter value
| Value | Description |
|---|---|
| expression | The expression specifies one or more CSS classes. |
other extensions