tinymceOptions 中的 angular-ui/ui-tinymce 设置方法破坏了模型绑定 [英] angular-ui/ui-tinymce setup method in tinymceOptions breaks model binding

查看:31
本文介绍了tinymceOptions 中的 angular-ui/ui-tinymce 设置方法破坏了模型绑定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想向 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>

添加 setup 函数打破了与模型的绑定.添加到编辑器的内容不会与模型同步,反之亦然.

Adding the setup function breaks the binding with the model. Content added to the editor is not synched to the model and vice-versa.

这种方法是否存在已知问题?Angular 版本: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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆