Currently, I am displaying a series of TinyMCE wysiwygs by utilizing the ng-repeat directive:
<div ng-repeat="widget in wigdets">
<textarea wysiwyg></textarea> <!-- This is a directive to initialize TinyMCE -->
</div>
Upon rearranging the order of widgets in the controller, the instances of TinyMCE are automatically adjusted as well.
An issue arises due to the fact that the TinyMCE widget functions within an iframe and when it is relocated within the DOM, the iframe's state is reset.
As a solution, I must save the content of TinyMCE, remove TinyMCE from the element before relocating it, then reinitialize TinyMCE and reapply the saved content once the movement is complete.
I am seeking a straightforward method to somehow integrate into ng-repeat and designate callbacks for element movements.
If it becomes necessary to develop my own ng-repeat-custom directive, what would be the ideal structure for organizing event dispatching in AngularJS?
Should events be transmitted to child directives? Or should child directives (such as wysiwyg) subscribe to events from parent directives?