its showing me above error if quill not installed and after installing quill with npm, code is working fine but only inserting <p> tag (paragraph tag) multiple times.
I'm working in React JS apps, <p> tags are adding instead of table. I tired exposing quill js file in index.html file. but still facing same issue. Can I get help in resolving this issue
APP.COMPONENT.TS
`import {Component, OnInit, AfterViewInit, ViewChild, ElementRef} from '@angular/core';
import QuillBetterTable from 'quill-better-table';
declare const Quill: any;
@Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.less'] }) export class AppComponent implements OnInit, AfterViewInit { @ViewChild('editable', {static: true}) editRef: ElementRef;
quill: any;
ngOnInit() { setTimeout(() => { this.initEditor(); }, 1000); }
initEditor(): void { Quill.register({ 'modules/better-table': QuillBetterTable }, true); // tslint:disable-next-line:no-unused-expression this.quill = new Quill(this.editRef.nativeElement, { theme: 'snow', modules: { table: false, 'better-table': { operationMenu: { items: { unmergeCells: { text: 'Another unmerge cells name' } } } }, keyboard: { bindings: QuillBetterTable.keyboardBindings } } } ); } ngAfterViewInit() { }
onInsertTable() { const tableModule = this.quill.getModule('better-table'); tableModule.insertTable(3, 3); } } `
its showing me above error if quill not installed and after installing quill with npm, code is working fine but only inserting
<p>
tag (paragraph tag) multiple times.