I am rendering a list of TinyMCE wysiwygs using ng-repeat directive:
<div ng-repeat="widget in wigdets">
<textarea wysiwyg></textarea> <!-- This is a directive to initialize TinyMCE -->
</div>
When i change the order of widgets in controller, TinyMCE's instances are automatically rearranged accordingly.
The problem is that TinyMCE widget is an iframe and iframe state gets reset when it is moved in DOM.
So i need to save TinyMCE contents and remove TinyMCE from element before it is moved and then init TinyMCE once again and apply saved contents after the movement is finished.
Is there a simple way to somehow hook into ng-repeat and to register callbacks for element movement?
If I have to write my own ng-repeat-custom directive, what is the proper architecture to organize event dispatching in angular way?
Should I somehow send events to child directives? Or should child directives (wysiwyg in my case) subscribe to events of parent directives?