为他的击键获取 Angular CKEditor5 实例

问题描述

角 12

打字稿 4.2

我关注了 this tutorial 以进行 CKEditor 集成。

我将从 CKEditor 访问 keystrokes

代码中的两个变量(editorComponent 和 ckEditor)都没有我可以访问击键的成员!?!?

如何获取 CKEditor 的实例以访问击键?

如何在 Angular 中访问 CKEditor 的按键?

我的 component.ts:

import * as ClassicEditor from '@ckeditor/ckeditor5-build-classic';

export class MyClass implements AfterViewChecked {
  @ViewChild('editor') editorComponent: CKEditorComponent;
  public ckEditor = ClassicEditor;
  myData = '<p>Hello World</p>';

  ngAfterViewChecked(): void {
    console.log(this.ckEditor); // undefined
    console.log(this.editorComponent.editor); // class _w extends xu{}
  }
}

我的 component.html:

  <ckeditor #editor [editor]="ckEditor" [data]="myData"></ckeditor>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)