diff --git a/js/angular/directive/content.js b/js/angular/directive/content.js index e85f4e7d5d..fa644e30e4 100644 --- a/js/angular/directive/content.js +++ b/js/angular/directive/content.js @@ -79,7 +79,6 @@ function($timeout, $controller, $ionicBind) { $onScroll: '&onScroll', $onScrollComplete: '&onScrollComplete', hasBouncing: '@', - scroll: '@', padding: '@', hasScrollX: '@', hasScrollY: '@', @@ -96,7 +95,7 @@ function($timeout, $controller, $ionicBind) { }); } - if ($scope.scroll === "false") { + if ($attr.scroll === "false") { //do nothing } else if(attr.overflowScroll === "true") { $element.addClass('overflow-scroll'); diff --git a/test/unit/angular/directive/content.unit.js b/test/unit/angular/directive/content.unit.js index 5cb7bfd291..6b6201ae5c 100644 --- a/test/unit/angular/directive/content.unit.js +++ b/test/unit/angular/directive/content.unit.js @@ -75,6 +75,20 @@ describe('Ionic Content directive', function() { expect(scroll.length).toBe(0); }); + it('should work scrollable with nested ionScroll elements', function() { + var element = compile( + '' + + '
' + + '' + + '' + + '
' + + '
')(scope); + scope.$apply(); + + expect(jqLite(element[0].querySelector('.content2')).controller('$ionicScroll')).toBeTruthy(); + expect(element.controller('$ionicScroll')).toBeFalsy(); + }); + it('should add padding classname to scroll element', function() { var element = compile('')(scope); var scroll = element.find('.scroll');