Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Done froala/angular-froala-wysiwyg#2066 #339

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/editor/editor.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,11 @@ export class FroalaEditorDirective implements ControlValueAccessor {
}

private setHtml() {
this._editor.html.set(this._model || "");
if (this._hasSpecialTag) {
this._editor.html.set(this._model || "");
} else {
this._editor.html.set(this._oldModel || "");
}

// This will reset the undo stack everytime the model changes externally. Can we fix this?
this._editor.undo.reset();
Expand All @@ -242,7 +246,9 @@ export class FroalaEditorDirective implements ControlValueAccessor {
// Set initial content
if (this._model || this._model == '') {
this._oldModel = this._model;
if (this._hasSpecialTag) {
}

if (this._hasSpecialTag) {

let tags: Object = this._model;

Expand All @@ -259,15 +265,14 @@ export class FroalaEditorDirective implements ControlValueAccessor {
this._element.innerHTML = tags[this.INNER_HTML_ATTR];
}
}
} else {
} else {
if (firstTime) {
this.registerEvent('initialized', function () {
self.setHtml();
});
} else {
self.setHtml();
}
}
}
}

Expand Down