diff --git a/src/carousel/carousel.js b/src/carousel/carousel.js index a01bf72891..dcd92d8f64 100644 --- a/src/carousel/carousel.js +++ b/src/carousel/carousel.js @@ -20,7 +20,7 @@ angular.module('ui.bootstrap.carousel', []) var destroyed = false; /* direction: "prev" or "next" */ self.select = $scope.select = function(nextSlide, direction) { - var nextIndex = self.indexOfSlide(nextSlide); + var nextIndex = $scope.indexOfSlide(nextSlide); //Decide direction if it's not given if (direction === undefined) { direction = nextIndex > self.getCurrentIndex() ? 'next' : 'prev'; @@ -86,7 +86,7 @@ angular.module('ui.bootstrap.carousel', []) }; /* Allow outside people to call indexOf on slides array */ - self.indexOfSlide = function(slide) { + $scope.indexOfSlide = function(slide) { return angular.isDefined(slide.index) ? +slide.index : slides.indexOf(slide); }; diff --git a/template/carousel/carousel.html b/template/carousel/carousel.html index 3b26a25814..6577b73f45 100644 --- a/template/carousel/carousel.html +++ b/template/carousel/carousel.html @@ -1,6 +1,6 @@