froala / angular-froala

Angular.js bindings for Froala WYSIWYG HTML Rich Text Editor.
https://froala.com/wysiwyg-editor
MIT License
306 stars 123 forks source link

immediateAngularModelUpdate option not work. #185

Closed towry closed 5 years ago

towry commented 6 years ago

I have to use froalaEditor.contentChanged event to update the model manually.

scope.froalaOptions = {
    language: 'zh_cn',
    theme: 'xxxx',
    toolbarButtons: [
        "bold", "italic", "underline", "|", "insertImage"
    ],
    events: {
        'froalaEditor.contentChanged': (e, editor) => {
            if (ignoreChange) {
                ignoreChange = false;
                return;
            }
                         // method to update the model.
            updateHtmlContent(editor.html.get(), true);
        }
    }
}

If there is an initialized value for the model, then froalaEditor.contentChanged event will be triggered, so I have to use ignoreChange to pass it.

stefanneculai commented 6 years ago

@towry do you think you could make a Plunker / jsFiddle to highlight this?

stefanneculai commented 5 years ago

Closing this due to lack of response.