Warm tip: This article is reproduced from serverfault.com, please click

Angular 6 DecoupledEditor Not showing page preview like in demo

发布于 2019-01-30 14:27:13

I want to use the document viewer from ckeditor. It looks like a normal ckeditor, i want the version with the page.

It looks like this: original

And in my app it looks like this: my app

I installed CKeditor with following:

npm install --save @ckeditor/ckeditor5-angular    
npm i @ckeditor/ckeditor5-build-decoupled-document

And used in HTML:

<ckeditor [editor]="Editor" data="<p>Hello, world!</p>" (ready)="onReady($event)"></ckeditor>

And in Component:

import * as DecoupledEditor from '@ckeditor/ckeditor5-build-decoupled-document';



public Editor = DecoupledEditor;

  public onReady(editor) {
    editor.ui.view.editable.element.parentElement.insertBefore(
      editor.ui.view.toolbar.element,
      editor.ui.view.editable.element
    );

  }
Questioner
Ilie Ionut-Cosmin
Viewed
0
Ilie Ionut-Cosmin 2019-01-31 21:18:59

You'll need some additional styles to get the native text processor look and feel. – oleq