diff --git a/src/carousel/carousel.js b/src/carousel/carousel.js index 6792cb48af..11a3a9045e 100644 --- a/src/carousel/carousel.js +++ b/src/carousel/carousel.js @@ -15,7 +15,7 @@ angular.module('ui.bootstrap.carousel', []) element: element }); slides.sort(function(a, b) { - return +a.slide.index > +b.slide.index; + return +a.slide.index - +b.slide.index; }); //if this is the first slide or the slide is set to active, select it if (slide.index === $scope.active || slides.length === 1 && !angular.isNumber($scope.active)) {