类型错误:无法读取 null 的属性“getAttribute”(angular6)

Kar*_*lla 5 ckeditor5 angular6

我正在使用 Angular 6 + CkEditor5 并且我收到“无法读取 null 的属性 'getAttribute'”。

我正在尝试从这里提到的源代码构建https://github.com/ckeditor/ckeditor5-angular/issues/26

在模板中:

<div id="editor"></div>

在打字稿中:

import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';
import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic';

ClassicEditor.create( document.querySelector( '#editor' ), {
  plugins: [ Bold, Italic ],
  toolbar: [ 'bold', 'italic']
} )
.then( editor => {
    console.log( 'Editor was initialized', editor );
} )
.catch( error => {
    console.error( error.stack );
} );```
Run Code Online (Sandbox Code Playgroud)