I am trying to install ckeditor to my angular project. I already tried installing ckeditor4-angular
via npm but was unable to find a way to add plugins like the WIRIS mathType. Please how can i install the editor to my angular project and as well install plugins?
Here is an issue regarding this https://github.com/ckeditor/ckeditor5-angular/issues/134. You need to create your custom CKEditor build and include necessary plugins into it. Here is the guide: https://ckeditor.com/docs/ckeditor5/latest/builds/guides/development/custom-builds.html BTW I suggest you to use CKEditor 5, the latest version.
UPD:
git clone https://github.com/ckeditor/ckeditor5-build-classic.git
npm install
npm install --save @wiris/mathtype-ckeditor5
src/ckeditor.js
and new plugin to the editor:...
import MathType from '@wiris/mathtype-ckeditor5';
...
ClassicEditor.builtinPlugins = [
...
MathType
];
ClassicEditor.defaultConfig = {
toolbar: {
items: [
...
'MathType',
...
]
},
...
};
yarn run build
build
folder to your project. For instancesrc/assets/js/ck-editor-math-type/
-> translations
-> ...
-> ckeditor.js
package.json
"dependencies": {
...
"@ckeditor/ckeditor5-angular": "^1.1.2",
...
}
import * as ClassicEditor from '../../assets/js/ck-editor-math-type/ckeditor.js';
...
export class CkeditComponent implements OnInit {
public Editor = ClassicEditor;
public model = {
editorData: '<p>Hello, world!</p>'
};
}
<ckeditor [(ngModel)]="model.editorData" [editor]="Editor"></ckeditor>
Hope this help you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With