Skip to content

Commit 26c0d5b

Browse files
AndreyAndrey
authored andcommitted
added clearing events on element destroy
1 parent 8c51a6d commit 26c0d5b

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

build/angular-cycle-gallery.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@
6363
GalleryEvents.on('index:update', function() {
6464
return updateIndex();
6565
});
66+
$element.on('$destroy', function() {
67+
return GalleryEvents.clear();
68+
});
6669
$scope.$watchCollection(_collectionName, function(items) {
6770
return mover.render(items);
6871
});
@@ -264,6 +267,9 @@
264267
}
265268
return results;
266269
}
270+
},
271+
clear: function() {
272+
return this._stack = {};
267273
}
268274
};
269275
}

0 commit comments

Comments
 (0)