mirror of
https://github.com/nasa/openmct.git
synced 2025-06-15 21:58:13 +00:00
[Tree] Begin wiring in selection
This commit is contained in:
@ -25,13 +25,17 @@ define([
|
||||
'angular',
|
||||
'../ui/TreeView'
|
||||
], function (angular, TreeView) {
|
||||
function MCTTree() {
|
||||
function link(scope, element) {
|
||||
var treeView = new TreeView();
|
||||
function MCTTree($parse) {
|
||||
function link(scope, element, attrs) {
|
||||
var treeView = new TreeView(),
|
||||
expr = $parse(attrs.mctModel),
|
||||
unobserve = treeView.observe(expr.assign.bind(expr, scope));
|
||||
|
||||
element.append(angular.element(treeView.elements()));
|
||||
|
||||
scope.$parent.$watch(attrs.mctModel, treeView.value.bind(treeView));
|
||||
scope.$watch('mctObject', treeView.model.bind(treeView));
|
||||
scope.$on('$destroy', unobserve);
|
||||
}
|
||||
|
||||
return {
|
||||
|
Reference in New Issue
Block a user