I want to get the selected node path from root in tree view by using AngularJS. I have seen this link. It is used to get only selected node like subUser2. But i want to display selected Node path or depth like user/subUser2.
If i select subUser2 : then display User/subUser2
jsfiddle.net/eu81273/8LWUc/18/
If we will add to HTML:
<pre>{{currentNode|json}}</pre>
we can see:Now the
roleId
is unique, in our case itsrole1211
where1211
represents parent indexes:root -> 1 -> 2 -> 1 -> 1
By this way its pretty easy to write single method that runs in loop on tree model and fetch child according to
root -> 1 -> 2 -> 1 -> 1