CKEDITOR错误代码:Angular 2中的editor-destroy-iframe

时间:2017-01-09 11:32:12

标签: angular ckeditor

我在ng2-ckeditor项目中使用Angular2。它工作正常,但当我继续使用其他组件时,它显示警告消息[CKEDITOR] Error code: editor-destroy-iframe

我谷歌寻求解决方案,并在下面找到解决方案:

for (name in CKEDITOR.instances) {
        CKEDITOR.instances[name].destroy(true);
    }

但是从哪里得到CKEDITOR。在ng2-ckeditor包中,我只能看到2个库CKEditorModule, CKEditorComponent

请帮我解决此问题。

1 个答案:

答案 0 :(得分:2)

尝试在devDependencies下的package.json中添加CKEditor的typescript定义文件(" @ types / ckeditor":" ^ 0.0.34"):

"devDependencies": {
    "@angular/compiler-cli": "~2.4.0",
    "@angular/platform-server": "~2.4.0",
    "@types/ckeditor": "^0.0.34"
}

然后运行npm update下载类型。 另一种解决方案是在文件中声明CKEditor:

declare const CKEDITOR: any;
相关问题