I was looking for information on how to use this control, and found the official documentation is pretty minimal. However, after much trial and error, I made it work, so I thought I'd share it.
In the end, I used the simple CKEditor 5 boot adapter with Angular 8, and it works just fine. However, you need to create a custom ckeditor assembly with the download adapter installed. This is pretty easy to do. I assume that you already have Angular ckeditor files.
First create a new angular project directory and name it "cKEditor-Custom-Build" or something like that. Do not run ng new (Angular CLI), but use npm instead to get the base assembly of the editor you want to show. For this example, I use the classic editor.
https:
Go to github and clone or upload the project to a new brilliant build directory.
if you use VS code, open the directory, open a terminal window and get the dependencies:
npm i
Now you have the basic assembly, and you need to install the adapter to boot. CkEditor has one. install this package to get a simple download adapter:
npm install --save @ckeditor/ckeditor5-upload
.. as soon as this is done, open the ckeditor.js file in the project. This is in the src directory. If you played with ckEditor, then its contents should look familiar.
Import the new js file into the ckeditor.js file. There will be a whole bunch of imports in this file, and they will go all the way down.
import SimpleUploadAdapter from '@ckeditor/ckeditor5-upload/src/adapters/simpleuploadadapter';
... Then add the import to your array of plugins. Since I use the classic editor, my section is called "ClassicEditor.builtinPlugins", add it next to the TableToolbar. This is all set up. No additional toolbars or settings are needed for this.
Create your ckeditor-custom-build.
npm run build
The magic of Angular will do the trick, and the build directory will be created in your project. Here it is for custom assembly.
Now open your angular project and create a directory for the new assembly. I actually put mine in a resource subdirectory, but it can be anywhere you can link to it.
Create a directory in "src / assets" called something like "ngClassicEditor", no matter what you call it, and copy the assembly file (that you just created) into it. Then, in the component that you want to use in the editor, add the import statement with the path to the new assembly.
import * as Editor from '@app/../src/assets/ngClassicEditor/build/ckeditor.js';
almost done...
The final bit is to configure the download adapter with the API endpoint that the adapter must use to download images. Create a config in your component class.
public editorConfig = { simpleUpload: {
};
I actually use environment conversion here when the URI changes from dev to production, but you can hardcode the direct URL if you want.
The last part is to configure your editor in the template to use the new configuration values. Open component.html and change the ckeditor editor tag.
<ckeditor [editor]="Editor" id="editor" [config]="editorConfig"> </ckeditor>
Here it is. You made. test, test test.
My API is the .Net API, and I am happy to share it if you need some sample code. I really hope this helps.