Skip to content

Commit

Permalink
fix(carousel): clear currentSlide when there are no slides
Browse files Browse the repository at this point in the history
- Clear `currentSlide` when slides have been emptied

Closes angular-ui#4021
  • Loading branch information
Loyc59 authored and wesleycho committed Jul 28, 2015
1 parent a65a5fa commit 0c78026
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/carousel/carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,11 @@ angular.module('ui.bootstrap.carousel', [])
} else if (currentIndex > index) {
currentIndex--;
}

//clean the currentSlide when no more slide
if (slides.length === 0) {
self.currentSlide = null;
}
};

$scope.$watch('noTransition', function(noTransition) {
Expand Down

0 comments on commit 0c78026

Please sign in to comment.