html:
<div class="todayEnergyTab"> <ul> <li ng-repeat="item in todayEnergyChart" ng-click="getTodayEnergyChart($index,item)" ng-class="{'current': $index === isSelected}">{{item.name}}</li> </ul> </div>
js:
$scope.isSelected = 0 $scope.getTodayEnergyChart = function (index,item) { $scope.isSelected = index // console.log(index,item) // console.log($scope.isSelected) }