Skip to content

Commit abd32d1

Browse files
Merge pull request #246 from CelestialSystem/cel-3049-1
v4.0.5-3049
2 parents 6e40e8b + 882fca3 commit abd32d1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/angular-froala.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@
116116
ctrl.editorInitialized = true;
117117
ngModel.$render()
118118
}
119+
//https://github.com/froala-labs/froala-editor-js-2/issues/3049
120+
if (ctrl.options.froalaEditor) {
121+
delete ctrl.options.froalaEditor;
122+
}
119123
ctrl.froalaEditor = new FroalaEditor(element[0], ctrl.options);
120124

121125
//assign the froala instance to the options object to make methods available in parent scope
@@ -142,11 +146,12 @@
142146
}
143147
}
144148

149+
if (!element) {
150+
return;
151+
}
145152
element.bind('$destroy', function() {
146-
if (element) {
147153
ctrl.froalaEditor.destroy();
148154
element = null;
149-
}
150155
});
151156
};
152157

0 commit comments

Comments
 (0)