问题
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);
}
But from where to get CKEDITOR
. In ng2-ckeditor
package, I can see only 2 library CKEditorModule, CKEditorComponent
.
Please help me to solve this.
回答1:
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"
}
Then run npm update to download the types. An alternate solution is to declare CKEditor in your file:
declare const CKEDITOR: any;
来源:https://stackoverflow.com/questions/41547096/ckeditor-error-code-editor-destroy-iframe-in-angular-2