Skip to content
This repository was archived by the owner on Aug 21, 2018. It is now read-only.

Commit bf4b5ec

Browse files
committed
refactor(carousel): make use of one function
Resolve this TODO since we're requiring 1.3 where the fix for `.one` has been merged.
1 parent f908c2b commit bf4b5ec

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/carousel/carousel.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,8 @@ angular.module('ui.bootstrap.carousel', [])
3333
angular.extend(self.currentSlide || {}, {direction: direction, active: false});
3434
if ($animate.enabled() && !$scope.noTransition && nextSlide.$element) {
3535
$scope.$currentTransition = true;
36-
// TODO: Switch to use .one when upgrading beyond 1.2.21
37-
// (See https://github.com/angular/angular.js/pull/5984)
38-
nextSlide.$element.on('$animate:close', function closeFn() {
36+
nextSlide.$element.one('$animate:close', function closeFn() {
3937
$scope.$currentTransition = null;
40-
nextSlide.$element.off('$animate:close', closeFn);
4138
});
4239
}
4340

0 commit comments

Comments
 (0)