From 757cb0f0157be7ea29db1e53da33272516ea4578 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Wed, 28 Oct 2015 10:18:59 -0700 Subject: [PATCH] [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. --- platform/representation/src/MCTInclude.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/platform/representation/src/MCTInclude.js b/platform/representation/src/MCTInclude.js index dc00c8b89d..768a84a5bc 100644 --- a/platform/representation/src/MCTInclude.js +++ b/platform/representation/src/MCTInclude.js @@ -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 {