- 我的文章列表。
- 每当我点击任何文章“对话框/模式”应该打开。
- 在这样的对话框或模式中,我的文章的内容有一个ckeditor元素。
- 当我点击第一个它像一个魅力工作。
- 问题是点击第二,第三,第四等
然后我就开始有这个错误之后。
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)
对我来说,解决方案很简单,告诉计算机当对话框/模式被关闭破坏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();
}
});
不要。避免这种情况。切勿编辑核心文件。 – Juan