tinymceOptions中的angular-ui/ui-tinymce设置方法破坏了模型绑定 [英] angular-ui/ui-tinymce setup method in tinymceOptions breaks model binding
问题描述
我想向tinymce工具栏添加一个自定义按钮,并按照文档中的说明向tinymceOptions添加一个设置功能:
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.
这种方法是否存在已知问题? 角版本:1.2.17(离子框架) ui-tinymce版本:0.0.5
Are there known issues with this approach? Angular version : 1.2.17 (Ionic framework) ui-tinymce version : 0.0.5
推荐答案
我知道这是个老问题,但是我回答了以供将来参考.
I know this is old issue, but I answer it for future references.
此问题已在 angular-ui/ui-tinymce中讨论并解决./issues/112 .解决方案只是更新库.
This issue was already discussed and resolved in angular-ui/ui-tinymce/issues/112. The solution is just to update the library.
这篇关于tinymceOptions中的angular-ui/ui-tinymce设置方法破坏了模型绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!