From e59020fec78120c26efebb95bc5848887f18612c Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Thu, 19 Oct 2017 10:57:51 -0700 Subject: [PATCH] [Views] Clear regions on destroy Clear regions when a view is destroyed. This causes a view's destroy method to be correctly invoked, allowing views to do cleanup. Used by NSS heatmap view for sprint Alice, https://github.com/nasa/openmct/projects/1 --- src/adapter/directives/MCTView.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/adapter/directives/MCTView.js b/src/adapter/directives/MCTView.js index 4fcc674155..3c5023fc41 100644 --- a/src/adapter/directives/MCTView.js +++ b/src/adapter/directives/MCTView.js @@ -33,6 +33,7 @@ define([ link: function (scope, element, attrs) { var region = new Region(element[0]); scope.$watch(attrs.mctView, region.show.bind(region)); + scope.$on("$destroy", region.clear.bind(region)); } }; }