像这样:
<div class="item" ng-repeat="priority in priorities" ng-class="{active: {{$index}} == {{routeParams.priorityId - 1}} }"></div>
<a class="carousel-control left" ng-hide="!goals.length" href="#myCarousel" ng-click="changePriorityIdParam($index)" data-slide="prev">‹</a>
app.controller("PriorityDetailController", function ($http, $scope, $location, $routeParams) {
console.log("PriorityDetailController - priorityId: " + $routeParams.priorityId);
getPriorityForPriorityId($http, $scope, $routeParams);
$scope.changePriorityIdParam = function(index) {
console.log("changePriorityIdParam() - index: " + index);
$location.path('/priority/' + index);
$location.replace();
};
})