I have a set of dom elements that needs to be modified in block. In the following example the "block" directive is going to add an edit link inside of it.
<div block>
<div editable="text1">this is editable</div>
<div editable="text2">this is another editable</div>
</div>
I want the edit link to populate another directive (called "panel"), with one input field per each editable element inside of the block. Of course the input fields must bind to the above dom elements. The blocks may be dinamycally placed inside of ng-switch and/or ng-repeat, so I need to consider the different scope levels.
The specific question is how do I make a directive modify the content of another directive ? I only found examples on how to make two directives communicate when attached to the same element.
At the moment I'm trying to use jQuery inside of the linking function of the "block" directive to get a list of the editable elements and display it in the "panel" using a controller scope property, but I couldn't make it work for ng-repeat/ng-switch.
If possible, a general suggestion on how to approach this problem in AngularJS is really appreciated!!
Thank you