jodit / jodit-angular

Angular wrapper for Jodit && Hey. Due to the fact that I do not use Angular in my projects, I cannot fix plugin errors in a timely manner. If you want the plugin to develop, send PR or better become a contributor
MIT License
48 stars 35 forks source link

Cannot disable after initialization #23

Open Ross-Blakeney opened 6 years ago

Ross-Blakeney commented 6 years ago

Issue: After initialization, updating the config object's disabled property does not disable the editor.

Expectation:

<jodit-editor [config]="config"></jodit-editor>

ngOnInit() {
        this.config = {
            enter: "DIV",
            toolbarAdaptive: false,
            disabled: false
        };
}

disableEditor() {
        this.config.disabled = true;
}

When called, "disableEditor()" should disable the wysiwyg. It currently does not.

My current work-around is to have two editors. One initialized with disabled = false, and one with disabled = true and use [hidden] to switch between the two as needed. Obviously not ideal.