diff --git a/js/angular/directive/scroll.js b/js/angular/directive/scroll.js index a362d22990e..f505deba449 100644 --- a/js/angular/directive/scroll.js +++ b/js/angular/directive/scroll.js @@ -19,6 +19,8 @@ * @param {boolean=} zooming Whether to support pinch-to-zoom * @param {integer=} min-zoom The smallest zoom amount allowed (default is 0.5) * @param {integer=} max-zoom The largest zoom amount allowed (default is 3) + * @param {boolean=} has-bouncing Whether to allow scrolling to bounce past the edges + * of the content. Defaults to true on iOS, false on Android. */ IonicModule .directive('ionScroll', [ @@ -70,6 +72,7 @@ function($timeout, $controller, $ionicBind) { var scrollViewOptions= { el: $element[0], delegateHandle: $attr.delegateHandle, + bouncing: $scope.$eval($attr.hasBouncing), paging: isPaging, scrollbarX: $scope.$eval($scope.scrollbarX) !== false, scrollbarY: $scope.$eval($scope.scrollbarY) !== false, diff --git a/test/unit/angular/directive/scroll.unit.js b/test/unit/angular/directive/scroll.unit.js index f424635ee01..8e8bb5d68eb 100644 --- a/test/unit/angular/directive/scroll.unit.js +++ b/test/unit/angular/directive/scroll.unit.js @@ -20,6 +20,11 @@ describe('Ionic Scroll Directive', function() { .toBe('handleThis'); }); + it('passes hasBouncing attribute', function() { + var el = compile('')(scope); + expect(el.controller('$ionicScroll')._scrollViewOptions.bouncing).toEqual(123); + }); + it('has $onScroll (used by $ionicScrollController)', function() { element = compile('')(scope); scope = element.scope();