diff --git a/js/angular/directive/infiniteScroll.js b/js/angular/directive/infiniteScroll.js index 41c9dbd083..f6896d97ec 100644 --- a/js/angular/directive/infiniteScroll.js +++ b/js/angular/directive/infiniteScroll.js @@ -119,7 +119,8 @@ IonicModule }); $scope.$on('$destroy', function() { - scrollCtrl.$element.off('scroll', checkBounds); + console.log(scrollCtrl); + if(scrollCtrl && scrollCtrl.$element)scrollCtrl.$element.off('scroll', checkBounds); }); var checkBounds = ionic.animationFrameThrottle(checkInfiniteBounds);