Closed exsoflowe closed 5 years ago
When you use AfterViewInit, AfterViewInit of tinymce component is not run yet, so the delay is needed. I will ship more events (outputs) soon, so you can rely on them.
Yes. I see in TinymceComponent.prototype.ngAfterViewInit
if (this.options.baseURL) {
tinymce.baseURL = this.options.baseURL;
}
tinymce.init(this.options);
Thanks!
Or we can use init_instance_callback in ngOnInit
this.editorRef.options.init_instance_callback = (editor) => {
editor.on('blur', (event) => {
this.onBlur.emit(this.editorRef.editor);
});
};
In version 3.3.0 you can use (init)
callback.
<app-tinymce (init)='actionOnInit($event)'></app-tinymce>
I try to get 'editor' property in AfterViewInit cycle. But I get undefined.
So I use setTimeout. Is it correct?
In my project I use setTimeout 0ms and I get editor instance. But in Stackblitz I need to use setTimeout 1000ms.
What am I doing wrong? Thanks.
Stackblitz example https://stackblitz.com/edit/angular2-tinymce-example-afterviewinit See app.component.ts