mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(scrollView): check that element has not yet been GC'd before removing event listeners in $destroy
This commit is contained in:
3
js/angular/directive/infiniteScroll.js
vendored
3
js/angular/directive/infiniteScroll.js
vendored
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user