问题
I want to add a custom button to the tinymce toolbar, and added a setup function to tinymceOptions as discribed in the docs:
$scope.tinymceOptions = {
setup: function (editor) {
editor.addButton('myMethod', { //myCode }
},
//more options
}
<textarea ui-tinymce="tinymceOptions" ng-model="model.content"></textarea>
Adding the setup function breaks the binding with the model. Content added to the editor is not synched to the model and vice-versa.
Are there known issues with this approach? Angular version : 1.2.17 (Ionic framework) ui-tinymce version : 0.0.5
回答1:
I know this is old issue, but I answer it for future references.
This issue was already discussed and resolved in angular-ui/ui-tinymce/issues/112. The solution is just to update the library.
来源:https://stackoverflow.com/questions/27320315/angular-ui-ui-tinymce-setup-method-in-tinymceoptions-breaks-model-binding