Open jaredmahan opened 6 years ago
After further digging, I found that this is not an issue of the angular plugin but rather of the editor itself, changing the template option in the editor does not take effect until the editor is destroyed and recreated. Below is the code changes I made, but I am hoping there is a better way to accomplish this rather than redrawing the entire component as it is not the most performant solution.
ngOnChanges(changes: SimpleChanges) { const config: SimpleChange = changes.config; if ( !!config && !!config.currentValue && config.previousValue && config.currentValue.theme !== config.previousValue.theme ) { let value = ''; if (!!this.editor.value) value = this.editor.value; this.editor.destruct(); this.editor = new Jodit(this.element, this.config); this.editor.value = value; } }
I have a theme toggle (from light to dark) on the page and it does not update the theme option unless I refresh the page and the editor is initialized with the theme value.