I recently tried to follow the guide on
It all seemed pretty clear.
import { createEditor } from 'lexical';
@Component({
selector: 'app-root',
standalone: true,
template: `
<div contenteditable="true" #editable></div>
`,
})
export class App implements AfterViewInit {
private editor = createEditor();
@ViewChild('editable') editable?: ElementRef<HTMLDivElement>;
ngAfterViewInit() {
const el = this.editable?.nativeElement;
if (el) {
this.editor.setRootElement(el);
console.log('set');
} else console.log('nop');
}
}
However, even after following the steps, I am not seeing any output or errors. What could be the issue here?