AngularJS ng-class-even
Directive
AngularJS Example
Set class="striped" for even rows in a 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>
Definition and Usage
The ng-class-even directive is used to dynamically bind one or more CSS classes to HTML elements, but only applies to even rows.
The ng-class-even directive must be used in conjunction with the ng-repeat directive.
The ng-class-even directive is recommended for styling tables, but it supports all HTML elements.
Syntax
Supported by all HTML elements.
Parameter Values
Value | Description |
---|---|
expression | Specifies one or more CSS classes. |