A, problem,

Angular2: [CKEDITOR] Error code [CKEDITOR] Error code: editor-destroy-iframe. ckeditor.js:21 [CKEDITOR] For more information about this error go to docs.ckeditor.com/#! / guide/DE… The linked documentation explains as follows:

We need to destroy ckeditor before uninstalling it from the DOM. Angular1 uses ckeditor to check if there is an instance of ckeditor when entering the page. If there is one, destroy it before creating a new one. It’s just how I implement the destruction process in Angular2. Several methods have been tried without success. I have no choice but to check github.com to see if there is an issue in ng2-ckeditor. Indeed as expected. For reference, change two import methods: one is the JS address of Ckeditor in index.html, the other is the location of ckeditor component in the page, and add plug-in requirements in config information.

2. Solution steps

  1. Change the js address introduced in the app’s index.html page to:

<ckeditor [(ngModel)]=” templatedata.content “[config]=”{extraPlugins: ‘divArea ‘}”> Add [config]=”{extraPlugins: ‘divArea ‘}”, where the plugin divArea is required

Third, summary

The problem is solved, but how it works remains to be seen. However, I realized that when I encountered problems that could not be solved, I should go back to the community and the root of the project.