Sho*_*ani 3 javascript jquery ckeditor
我正在CKEditor我的应用程序中实现。当我尝试实例化CKEditor到 textarea 时,出现以下错误
Cannot read property 'getSelection' of undefined
Run Code Online (Sandbox Code Playgroud)
在 ckeditor 的下面一行
getNative: function() {
return void 0 !== this._.cache.nativeSel ? this._.cache.nativeSel : this._.cache.nativeSel = B ? this.document.$.selection : this.document.getWindow().$.getSelection() }
Run Code Online (Sandbox Code Playgroud)
任何帮助深表感谢。
然后我开始出现这个错误。
TypeError: Cannot read property 'getSelection' of undefined
at CKEDITOR.dom.selection.getNative (ckeditor.js:448)
at new CKEDITOR.dom.selection (ckeditor.js:446)
at a.CKEDITOR.editor.getSelection (ckeditor.js:443)
at new CKEDITOR.plugins.undo.Image (ckeditor.js:1182)
at CKEDITOR.plugins.undo.UndoManager.save (ckeditor.js:1177)
at a.<anonymous> (ckeditor.js:1173)
at a.n (ckeditor.js:10)
at a.CKEDITOR.event.CKEDITOR.event.fire (ckeditor.js:12)
at a.CKEDITOR.editor.CKEDITOR.editor.fire (ckeditor.js:13)
at a.setData (ckeditor.js:275)
Run Code Online (Sandbox Code Playgroud)
我的解决方案很简单,告诉计算机在对话框/模式关闭时销毁 ckeditor 实例。容易!..现在就像一个魅力=)
$mdDialog.show({
parent: parentEl,
targetEvent: $event,
templateUrl: '/md-templates/blog-article.html',
controller: DialogController,
scope: $scope,
preserveScope: true,
onRemoving: function (event, removePromise) {
if (CKEDITOR.instances.body) CKEDITOR.instances.body.destroy();
}
});
Run Code Online (Sandbox Code Playgroud)