I installed a text editor called Jodit and I'm having some issues trying to integrate it into my angular application.
In order, I did:
npm install --save jodit- Added in angular.json build-options-sripts
"node_modules/jodit/build/jodit.min.js" - Added in angular.json build-options-styles
"node_modules/jodit/build/jodit.min.css"
Here is my component:
import * as jodit from 'jodit';
@Component({
selector: 'app-test',
styleUrls: ['./test.component.scss'],
template: `
<textarea id="test" name="editor"></textarea>
`
})
export class TestComponent implements OnInit {
public editor: any;
constructor() {}
ngOnInit() {//
const elem: HTMLElement = document.getElementById('test');
this.editor = new jodit.Jodit(elem, {});
}
Im getting the following errors
src/app/test.component.ts(21,28): error TS2339: Property 'Jodit' does not exist on type 'typeof import("C:/Users/test/Desktop/test/node_modules/jodit/src/types/index")'.
src/app/test.component.ts(41,27): error TS2339: Property 'Jodit' does not exist on type 'typeof import("C:/Users/test/Desktop/test/node_modules/jodit/src/types/index")'.
I can't compile it, but with npm start I can make it working (I still have the errors but it compiles and I can see the text editor).
Am I missing something, it looks like a type linkage error?