I'm using "angular-ui-tree": "^2.22.5"
<div ui-tree-handle
class="tree-node ctg-tree-node-content ng-scope angular-ui-tree-handle"
ng-click="ctrl.selectPage(this)">
In the controller for this component
public selectPage(item: any) {
console.log('depth of selected node: ' + item.depth());
item.$nodeScope.insertNode(0, {
name: 'dummy new child node'
});
}
This adds a new node into the tree, but its a sibling to the selected node .. how can I add my new node as a child of the selected node?
The clicked node, may or may not have any children already.