Execute
<!DOCTYPE html> <html> <head> <title>Wikitechy AngularJS Tutorials</title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.min.js"> </script> <style> .striped { background-color:yellow; width:100px; } </style> </head> <body ng-app="myApp"> <h2>Wikitechy ng-class-odd directive in AngularJs</h2> <ul ng-controller="ngclassoddCtrl"> <li ng-repeat="x in technology" ng-class-odd="'striped'"> {{x.tut}} </li> </ul> <script> var app = angular.module("myApp", []); app.controller("ngclassoddCtrl", function($scope) { $scope.technology = [ {"tut":"HTML"}, {"tut":"AngularJS"}, {"tut":"CSS"}, {"tut":"C"}, {"tut":"JAVA"}, {"tut":"PHP"}, ]; }); </script> </body> </html>
www.wikitechy.com © Copyright 2016. All Rights Reserved.