AngularJS ng-class-odd instruction
AngularJS examples
Odd rows of the table set class = "striped":
<Table ng-controller = "myCtrl ">
<Tr ng-repeat = "x in records" ng-class-odd = " 'striped'">
<Td> {{x.Name}} </ td>
<Td> {{x.Country}} </ td>
</ Tr>
</ Table>
<Tr ng-repeat = "x in records" ng-class-odd = " 'striped'">
<Td> {{x.Name}} </ td>
<Td> {{x.Country}} </ td>
</ Tr>
</ Table>
try it"
Definition and Usage
ng-class-odd instruction is used to bind a dynamic HTML elements or more CSS classes, but only act on the odd-numbered lines.
ng-class-odd instruction needs and ng-repeatinstruction with use.
ng-class-odd instruction suggested in the table style rendering, but all HTML elements are supported.
grammar
<Element ng-class-odd = "expression"> </ element>
All HTML elements are supported.
Parameter Value
value | description |
---|---|
expression | Expression specify one or more CSS classes. |