Background:
I am trying to setup a tree view from a JSON schema - I do this using directive schema-tree
as I setup in this code. Within the view I am trying to transclude DOM elements so that this treeview can be reused. However, since there is a copy of the transcluded DOM for each endpoint, I need to determine which copy of the transcluded DOM in the recursion has been accessed.
Problem: However, my attempts at accessing the this scope have failed. The best I have come up with is to modify the scope in the compile function of the directive but this changes the transclude scope only to the value of first invocation of the directive and not recursively for every invocation.
Code:
Please find Plunker here: http://plnkr.co/edit/3wmUbMTPNuBHXYOKHsho?p=preview
In this code schema-tree
is a recursive tree in which I am trying extract path
variable for each recursion upon the button click. I can get the path
within each directive but not in the associated Transcluded DOM where I get only .root
.
Question:
What am I doing wrong? How can I access the path
of the immediate parent in the transcluded DOM.
On a related note should I use another approach to solve this problem?
Thanks in advance!!!!!!!