I am using angular treeview to build a tree using angularjs. Once I select a node, I want to know the 'parent node' of the selected one.
I don't want to add an attribute named 'parent' in the json data and also don't want to create any array of parent-child key-value pair.
What changes can be done in initial files to get the result?
HTML
<div ng-app="myApp">
<div ng-controller="myController">
<div style="display:table-row; width:500px;">
<div style="display:table-cell; width:250px;">
<div style="margin:10px 5px 30px 5px; padding:10px; background-color:#EEEEEE; border-radius:5px; font:12px Tahoma;">
<span><b>First Tree's Selected Node</b> : <br>{{tree01.currentNode.roleName}}</span>
</div>
</div>
<div style="display:table-cell; width:250px;">
<div style="margin:10px 5px 30px 5px; padding:10px; background-color:#EEEEEE; border-radius:5px; font:12px Tahoma;">
<span><b>Second Tree's Selected Node</b> : <br>{{tree02.currentNode.roleName}}</span>
</div>
</div>
</div>
<div style="display:table-row; width:500px;">
<div style="display:table-cell; width:250px;">
<!-- FIRST TREE -->
<div data-angular-treeview="true" data-tree-id="tree01" data-tree-model="roleList1" data-node-id="roleId" data-node-label="roleName" data-node-children="children">
</div>
</div>
<div style="display:table-cell; width:250px;">
<!-- SECOND TREE -->
<div data-angular-treeview="true" data-tree-id="tree02" data-tree-model="roleList2" data-node-id="roleId" data-node-label="roleName" data-node-children="children">
</div>
</div>
</div>
</div>
</div>