[Tree] Trigger digest on tree selection change

This commit is contained in:
Victor Woeltjen 2016-03-11 17:37:11 -08:00
parent a3a9393d1b
commit 02ec6db104

View File

@ -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()));