Skip to content

Commit 8fdc611

Browse files
committed
Merge pull request #197 from sorich87/ionicVirtualRepeat-cleanup
virtualRepeat directive cleanup
2 parents 94560a6 + 1f52d9d commit 8fdc611

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
@@ -26568,6 +26568,10 @@ angular.module('ionic.ui.virtualRepeat', [])
2656826568
// When the user scrolls, we move the `state.firstActive`
2656926569
dom.bind('momentumScrolled', sfVirtualRepeatOnScroll);
2657026570

26571+
scope.$on('$destroy', function () {
26572+
dom.unbind('momentumScrolled', sfVirtualRepeatOnScroll);
26573+
});
26574+
2657126575
// The watch on the collection is just a watch on the length of the
2657226576
// collection. We don't care if the content changes.
2657326577
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)