CKEDITOR错误代码:Angular 2中的editor-destroy-iframe [英] CKEDITOR Error code: editor-destroy-iframe in Angular 2
问题描述
我正在Angular2
项目中使用ng2-ckeditor
.它工作正常,但是当我转到另一个组件时,它显示警告消息[CKEDITOR] Error code: editor-destroy-iframe
.
我在google上寻求解决方案,并在以下解决方案中找到了
I am using ng2-ckeditor
in my Angular2
project. It is working fine but when I go on another component, It shows warning message [CKEDITOR] Error code: editor-destroy-iframe
.
I google for solution and found below solution:
for (name in CKEDITOR.instances) {
CKEDITOR.instances[name].destroy(true);
}
但是从哪里获得CKEDITOR
.在ng2-ckeditor
包中,我只能看到2个库CKEditorModule, CKEditorComponent
.
请帮助我解决这个问题.
But from where to get CKEDITOR
. In ng2-ckeditor
package, I can see only 2 library CKEditorModule, CKEditorComponent
.
Please help me to solve this.
推荐答案
尝试在devDependencies("@ types/ckeditor":"^ 0.0.34")下的package.json中添加CKEditor的打字稿定义文件:
Try adding the typescript definition file for CKEditor in package.json under devDependencies ("@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:
Then run npm update to download the types. An alternate solution is to declare CKEditor in your file:
declare const CKEDITOR: any;
这篇关于CKEDITOR错误代码:Angular 2中的editor-destroy-iframe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!