ng-class-even for even

Description

We can add style for odd numbered item with ng-class-even.

Example


<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.js"></script>
<style>
.odd {<!--from w w  w.jav a2 s.com-->
   color: red;
}
.even {
   color: blue;
}
</style>
</head>
<body>
  <div ng-app="">
  <ol ng-init="names=['John', 'Mary', 'Cate', 'Suz']">
    <li ng-repeat="name in names"  ng-class-odd="'odd'" ng-class-even="'even'">
       {{name}}
    </li>
  </ol>
</div>
</body>
</html>

Click to view the demo





















Home »
  AngularJS »
    AngularJS Example »




Controller
Directives
Expression
Filter
Form
Inject
Scope
Server
Style
Template
Utilities