0

我已经使用了这个解决方案https://github.com/mswilson4040/ckangular,它解决了我的 ckeditor 不能在 Angular 中工作的问题。在这里,他们首先为将在其上创建其实例的编辑器创建 html,然后调用 ckedtor create 函数。现在我有一个模式,其中首先呈现 html,然后我需要创建 ckeditor 实例。我目前正在使用下面的代码来实现这一点:

//where editor instance will be created.
<span *ngIf="generate">
{{generateEditors()}}//calling type script function to create a instance on above

.ts:
generateEditors() {
debugger;
this.ckEditor = new CkEditor();
this.ckEditor.create('purpose-editor');
this.generate = false;
}

这个函数的问题是它一次又一次地无限调用,我的应用程序挂起。

Seconfly 我已经安装了 ng-onload 包,但我不知道如何在 //where 将创建编辑器实例的地方导入和使用它。

在这两种情况下的快速帮助将不胜感激。

4

0 回答 0