Skip to content
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