mirror of
https://github.com/nasa/openmct.git
synced 2025-06-15 21:58:13 +00:00
[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
This commit is contained in:
@ -33,6 +33,7 @@ define([
|
|||||||
link: function (scope, element, attrs) {
|
link: function (scope, element, attrs) {
|
||||||
var region = new Region(element[0]);
|
var region = new Region(element[0]);
|
||||||
scope.$watch(attrs.mctView, region.show.bind(region));
|
scope.$watch(attrs.mctView, region.show.bind(region));
|
||||||
|
scope.$on("$destroy", region.clear.bind(region));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user