YouTip LogoYouTip

Ng Ng Class Odd

AngularJS ng-class-odd Directive

-- Learning is not just about technology, but also about dreams!

AngularJS Tutorial

AngularJS Examples

AngularJS Reference

Deep Dive

AngularJS ng-class-odd Directive

AngularJS Reference

AngularJS Examples

Set class="striped" for odd rows in a table:

<table ng-controller="myCtrl">
<tr ng-repeat="x in records" ng-class-odd="'striped'">
    <td>{{x.Name}}</td>
    <td>{{x.Country}}</td>
</tr>
</table>

Try it yourself Β»

Definition and Usage

The ng-class-odd directive dynamically binds one or more CSS classes to an HTML element, but only applies to odd rows.

The ng-class-odd directive must be used in conjunction with the ng-repeat directive.

The ng-class-odd directive is recommended for styling tables, but all HTML elements are supported.

Syntax

<element ng-class-odd="expression"></element>

All HTML elements support it.

Parameter Values

Value Description
expression An expression that specifies one or more CSS classes.

AngularJS Reference

AngularJS Reference

AngularJS Examples

Click to share notes

Advertisement

My Favorites

Mark Article

Browsing History

Clear All

No records yet

← Ionic SelectIonic Radio β†’