From b820b96092ae4f3a5046900fe734ac281d977908 Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Thu, 9 Oct 2014 20:26:02 -0500 Subject: [PATCH] chore(listView): deregister listView on destroy --- js/angular/directive/list.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/js/angular/directive/list.js b/js/angular/directive/list.js index 44a1dcaa9a..c4d836b94a 100644 --- a/js/angular/directive/list.js +++ b/js/angular/directive/list.js @@ -117,6 +117,13 @@ function($animate, $timeout) { } }); + $scope.$on('$destroy', function() { + if(listView) { + listView.deregister && listView.deregister(); + listView = null; + } + }); + if (isDefined($attr.canSwipe)) { $scope.$watch('!!(' + $attr.canSwipe + ')', function(value) { listCtrl.canSwipeItems(value);