From 02ec6db104ea759053c85cc991e984f3b6289ee1 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Fri, 11 Mar 2016 17:37:11 -0800 Subject: [PATCH] [Tree] Trigger digest on tree selection change --- platform/commonUI/general/src/directives/MCTTree.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/platform/commonUI/general/src/directives/MCTTree.js b/platform/commonUI/general/src/directives/MCTTree.js index c48d1775a7..18641b3941 100644 --- a/platform/commonUI/general/src/directives/MCTTree.js +++ b/platform/commonUI/general/src/directives/MCTTree.js @@ -29,8 +29,12 @@ define([ function link(scope, element, attrs) { var treeView = new TreeView(), expr = $parse(attrs.mctModel), - assign = expr.assign.bind(expr, scope.$parent), - unobserve = treeView.observe(assign); + unobserve = treeView.observe(function (domainObject) { + if (domainObject !== expr(scope.$parent)) { + expr.assign(scope.$parent, domainObject); + scope.$apply(); + } + }); element.append(angular.element(treeView.elements()));