Skip to content

Commit 1f52d9d

Browse files
committed
virtualRepeat directive cleanup
1 parent 510c2db commit 1f52d9d

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

dist/js/ionic-angular.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26578,6 +26578,10 @@ angular.module('ionic.ui.virtualRepeat', [])
2657826578
// When the user scrolls, we move the `state.firstActive`
2657926579
dom.bind('momentumScrolled', sfVirtualRepeatOnScroll);
2658026580

26581+
scope.$on('$destroy', function () {
26582+
dom.unbind('momentumScrolled', sfVirtualRepeatOnScroll);
26583+
});
26584+
2658126585
// The watch on the collection is just a watch on the length of the
2658226586
// collection. We don't care if the content changes.
2658326587
scope.$watch(sfVirtualRepeatWatchExpression, sfVirtualRepeatListener, true);

js/ext/angular/src/directive/ionicVirtualRepeat.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,10 @@ angular.module('ionic.ui.virtualRepeat', [])
313313
// When the user scrolls, we move the `state.firstActive`
314314
dom.bind('momentumScrolled', sfVirtualRepeatOnScroll);
315315

316+
scope.$on('$destroy', function () {
317+
dom.unbind('momentumScrolled', sfVirtualRepeatOnScroll);
318+
});
319+
316320
// The watch on the collection is just a watch on the length of the
317321
// collection. We don't care if the content changes.
318322
scope.$watch(sfVirtualRepeatWatchExpression, sfVirtualRepeatListener, true);

0 commit comments

Comments
 (0)