The ngClassOdd
and ngClassEven
directives work exactly as
ngClass, except they work in
conjunction with ngRepeat
and take effect only on odd (even) rows.
This directive can be applied only within the scope of an ngRepeat.
<ANY
ng-class-even="expression">
...
</ANY>
<ANY class="ng-class-even: expression;"> ... </ANY>
Param | Type | Details |
---|---|---|
ngClassEven | expression |
Expression to eval. The result of the evaluation can be a string representing space delimited class names or an array. |
<ol ng-init="names=['John', 'Mary', 'Cate', 'Suz']">
<li ng-repeat="name in names">
<span ng-class-odd="'odd'" ng-class-even="'even'">
{{name}}
</span>
</li>
</ol>