AngularJS ng-class-odd Directive
-- Learning is not just about technology, but also about dreams!
AngularJS Tutorial
- AngularJS Tutorial
- AngularJS Introduction
- AngularJS Expressions
- AngularJS Directives
- AngularJS Model
- AngularJS Scope
- AngularJS Controllers
- AngularJS Filters
- AngularJS Service
- AngularJS Http
- AngularJS Select
- AngularJS Tables
- AngularJS SQL
- AngularJS HTML DOM
- AngularJS Events
- AngularJS Modules
- AngularJS Forms
- AngularJS Input Validation
- AngularJS API
- AngularJS Bootstrap
- AngularJS Includes
- AngularJS Animations
- AngularJS Dependency Injection
- AngularJS Routing
- AngularJS Application
AngularJS Examples
AngularJS Reference
Deep Dive
AngularJS ng-class-odd Directive
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>
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
Advertisement
My Favorites
Mark Article
Browsing History
Clear All
No records yet
YouTip