<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
<script src="Scripts/angular.js"></script>
<script>
var app = angular.module('app', []);
app.controller("MyCtrl", function($scope)
{
$scope.isSet = function(index)
{
return index % 2 === 0;
};
})
</script>
<style>
.active
{
color: red;
}
</style>
</head>
<body ng-app="app" ng-controller="MyCtrl">
<div>
<div ng-repeat="i in [1,2,3,4,5]" ng-class="{'active': isSet($index)}">{{i}}</div>
</div>
</body>
</html>This code snippet is for ng-repeat index to apply color using ng-class.