1

I was looking in ckeditor documentation and I couldn't find the solution to add insert image via url to an existing document editor build, I managed to successfully integrate the ckeditor (I choose document editor not classic editor), but I need the image upload via url feature so I followed some examples in documentation and I got an error ckeditor-duplicated-modules when I visited the link which describe this issue, I found that I should call my build from src/decoupled-editor, but there is no src folder in ckeditor node_modules. is there any simple solution to add image-upload via url in document-editor in angular?

this is part of my ts file which contains ckeditor:

import * as DecoupledEditor from "@ckeditor/ckeditor5-build-decoupled-document";
import ImageInsert from "@ckeditor/ckeditor5-image/src/imageinsert";

export class HomeComponent implements OnInit {
  public Editor = DecoupledEditor;
  public model = {
    editorData: "<p>Hello, world!</p>",
  };

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

  ngOnInit() {
    this.Editor.create(document.querySelector("#ckeditor"), {
      plugins: [ImageInsert],
      toolbar: ["imageInsert"],
    });
  }
}

This is the ck part of my html file:

<ckeditor
  formControlName="content"
  [editor]="Editor"
  [(ngModel)]="model.editorData"
  (ready)="onReady($event)"
></ckeditor>

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.