Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Commit 0c78026

Browse files
Loyc59wesleycho
authored andcommitted
fix(carousel): clear currentSlide when there are no slides
- Clear `currentSlide` when slides have been emptied Closes #4021
1 parent a65a5fa commit 0c78026

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/carousel/carousel.js

+5
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,11 @@ angular.module('ui.bootstrap.carousel', [])
178178
} else if (currentIndex > index) {
179179
currentIndex--;
180180
}
181+
182+
//clean the currentSlide when no more slide
183+
if (slides.length === 0) {
184+
self.currentSlide = null;
185+
}
181186
};
182187

183188
$scope.$watch('noTransition', function(noTransition) {

0 commit comments

Comments
 (0)