diff --git a/src/carousel/carousel.js b/src/carousel/carousel.js index 4fb09b7e87..5155d4610e 100644 --- a/src/carousel/carousel.js +++ b/src/carousel/carousel.js @@ -154,6 +154,18 @@ angular.module('ui.bootstrap.carousel', ['ui.bootstrap.transition']) } } }; + + // watch the paused attribute for changes + $scope.$watch('paused', function() { + + if($scope.paused) { + $scope.pause(); + } else { + $scope.play(); + } + + }); + }]) .directive('carousel', [function() { return { @@ -165,7 +177,8 @@ angular.module('ui.bootstrap.carousel', ['ui.bootstrap.transition']) templateUrl: 'template/carousel/carousel.html', scope: { interval: '=', - noTransition: '=' + noTransition: '=', + paused: '=' } }; }]) diff --git a/src/carousel/docs/demo.html b/src/carousel/docs/demo.html index 954ef9dd4f..2f61ce46ba 100644 --- a/src/carousel/docs/demo.html +++ b/src/carousel/docs/demo.html @@ -1,5 +1,5 @@