angular.directive.ng:class-even
Description
The ng:class-odd
and ng:class-even
works exactly as
ng:class
, except it works in conjunction with ng:repeat
and takes affect only on odd (even) rows.
Usage
<ANY ng:class-even="expression">
...
</ANY>
Parameters
expression – {expression} –
to eval. Must be inside
ng:repeat
.
Example
<ol ng:init="names=['John', 'Mary', 'Cate', 'Suz']">
<li ng:repeat="name in names">
<span ng:class-odd="'ng-format-negative'"
ng:class-even="'ng-input-indicator-wait'">
{{name}}
</span>
</li>
</ol>
it('should check ng:class-odd and ng:class-even', function(){
expect(element('.doc-example-live li:first span').attr('className')).
toMatch(/ng-format-negative/);
expect(element('.doc-example-live li:last span').attr('className')).
toMatch(/ng-input-indicator-wait/);
});