I'm trying to install a plugin called Math equations and chemical formulas for entering LaTex in CKEditor5 in Angular 8
. How do I add that plugin and toolbar in CKEditor 5
I tried adding the configuration in CKEditor tag in HTML and add plugins and toolbar details in ts file
ckeditor.component.ts
import {Component, OnInit} from '@angular/core';
import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
import MathType from '@wiris/mathtype-ckeditor5';
ClassicEditor
.create(document.querySelector('#editor'), {
plugins: [MathType],
toolbar: ['MathType']
}).then(editor => {
console.log('Editor was initialized', editor);
})
.catch(error => {
console.error(error);
});
@Component({
selector: 'app-ckeditor',
templateUrl: './ckeditor.component.html',
styleUrls: ['./ckeditor.component.scss']
})
export class CkeditorComponent implements OnInit {
public Editor = ClassicEditor;
constructor() { }
ngOnInit() { }
}
ckeditor.component.html
<ckeditor id="editor"
[editor]="Editor">
</ckeditor>
I expect to see the CKEditor 5 with the math equations toolbar which supports latex input
Edit: i am currently receiving this error, the version im using is @wiris/mathtype-ckeditor5@7.17.0
:4200/main.js:482 TypeError: Cannot read property 'getAttribute' of null
at IconView._updateXMLContent (:4200/vendor.js:139959)
at IconView.render (:4200/vendor.js:139935)
at IconView.<anonymous> (:4200/vendor.js:148840)
at IconView.fire (:4200/vendor.js:146753)
at IconView.<computed> [as render] (:4200/vendor.js:148844)
at ViewCollection.<anonymous> (:4200/vendor.js:143322)
at ViewCollection.fire (:4200/vendor.js:146753)
at ViewCollection.add (:4200/vendor.js:143914)
at ButtonView.render (:4200/vendor.js:138797)
at ButtonView.<anonymous> (:4200/vendor.js:148840)
all i can see is a text called 'Rich Text Editor' and a blank textfield which does not take any input. screen shot here