TypeError:无法读取null的属性'getAttribute'(angular6)

时间:2019-05-04 06:36:51

标签: angular6 ckeditor5

我正在使用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 );
} );```

0 个答案:

没有答案