diff --git a/js/angular/directive/slideBox.js b/js/angular/directive/slideBox.js index c639b1183d6..9d0f4630d56 100644 --- a/js/angular/directive/slideBox.js +++ b/js/angular/directive/slideBox.js @@ -27,7 +27,8 @@ * * @param {string=} delegate-handle The handle used to identify this slideBox * with {@link ionic.service:$ionicSlideBoxDelegate}. - * @param {boolean=} does-continue Whether the slide box should automatically slide. + * @param {boolean=} does-continue Whether the slide box should loop. + * @param {boolean=} auto-play Whether the slide box should automatically slide. Default true if does-continue is true. * @param {number=} slide-interval How many milliseconds to wait to change slides (if does-continue is true). Defaults to 4000. * @param {boolean=} show-pager Whether a pager should be shown for this slide box. * @param {expression=} pager-click Expression to call when a pager is clicked (if show-pager is true). Is passed the 'index' variable. @@ -45,6 +46,7 @@ function($timeout, $compile, $ionicSlideBoxDelegate) { replace: true, transclude: true, scope: { + autoPlay: '=', doesContinue: '@', slideInterval: '@', showPager: '@', @@ -57,7 +59,8 @@ function($timeout, $compile, $ionicSlideBoxDelegate) { var _this = this; var continuous = $scope.$eval($scope.doesContinue) === true; - var slideInterval = continuous ? $scope.$eval($scope.slideInterval) || 4000 : 0; + var shouldAutoPlay = isDefined($attrs.autoPlay) ? !!$scope.autoPlay : true; + var slideInterval = shouldAutoPlay ? $scope.$eval($scope.slideInterval) || 4000 : 0; var slider = new ionic.views.Slider({ el: $element[0], diff --git a/test/html/slideBox.html b/test/html/slideBox.html index 3c67f59630e..5b3d46e35b1 100644 --- a/test/html/slideBox.html +++ b/test/html/slideBox.html @@ -47,7 +47,7 @@ <ion-side-menus> <ion-side-menu-content> <ion-header-bar left-buttons="leftButtons" right-buttons="rightButtons" title=""></ion-header-bar> - <ion-slide-box on-slide-changed="slideChanged(index)" show-pager="true" pager-click="pagerClick(index)"> + <ion-slide-box on-slide-changed="slideChanged(index)" show-pager="true" pager-click="pagerClick(index)" does-continue="true" auto-play="false"> <ion-slide ng-controller="FirstSlideCtrl"> <h3>Thank you for choosing the Awesome App!</h3> <div id="logo">