fix(collectionRepeat): remove elements at correct time when leaving page

This commit is contained in:
Andrew Joslin
2014-06-11 08:41:50 -06:00
parent e6f79cc0ff
commit 30a3c8e0c8
4 changed files with 4 additions and 33 deletions

View File

@@ -48,14 +48,7 @@ function($cacheFactory, $parse, $rootScope) {
destroy: function() {
this.dimensions.length = 0;
this.data = null;
forEach(this.backupItemsArray, function(item) {
this.destroyItem(item);
}, this);
this.backupItemsArray.length = 0;
forEach(this.attachedItems, function(item, key) {
this.destroyItem(item);
}, this);
this.attachedItems = {};
},
calculateDataDimensions: function() {

View File

@@ -78,9 +78,10 @@ function($rootScope, $timeout) {
CollectionRepeatManager.prototype = {
destroy: function() {
for (var i in this.renderedItems) {
this.removeItem(i);
}
this.renderedItems = {};
this.render = angular.noop;
this.calculateDimensions = angular.noop;
this.dimensions = [];
},
/*