Closed nicolasgarnil closed 8 years ago
This is related to issue #158.
In order to not initialize TinyMCE until the options are defined add an ng-if check to the text area:
<textarea ui-tinymce="tinymceOptions" ng-model="email.body" ng-if="tinymceOptions"></textarea>
I am going to close this ticket in favor of #158 for now. I will open a new bug about the refresh event not removing the old editor, as I have seen that too.
In the future please ask any questions you may have using the angular-ui-tinymce tag on StackOverflow.
If you have reproducible bugs, continue opening issues attaching a Plunker describing the issue.
That workaround doesn't works when you need to re-initialise the editor more than one time. After the options are defined you can no longer re-initialise the editor. In my example, the template can be changed more than once.
That makes sense. I am hoping this will get fixed by the other bugs open.
I do agree that when the options change the editor should re-initalize, so I hope to get that feature in there.
In the mean time, we welcome all pull requests if you have any time to implement the feature.
I can't initialise the editor with the
content_css
option set to a value which is obtained from an XHR request because the link function of the directive is called before the callback of the XHR request. As a consequence of this, the options are not passed to the directive.If I broadcast a
$tinymce:refresh
event after initialising the options, the editor gets re-initialised with the new options, but the old editor is not removed.I a have little experience in angular directives, is it possible to watch changes in the options and reflect them in the editor? It would be a great feature of this directive.