[Representation] Watch for key changes

...from mct-include. Improves behavior of that directive and supports
testing of changes to remove whole elements when inapplicable,
nasa/openmctweb#195.
This commit is contained in:
Victor Woeltjen 2015-10-28 10:18:59 -07:00
parent a2d06583ca
commit 757cb0f015

View File

@ -70,8 +70,10 @@ define(
});
function controller($scope) {
// Pass the template URL to ng-include via scope.
$scope.inclusion = templateMap[$scope.key];
$scope.$watch('key', function (key) {
// Pass the template URL to ng-include via scope.
$scope.inclusion = templateMap[$scope.key];
});
}
return {