Skip to content

Commit 00abcc1

Browse files
committed
Fixed memory leak on event
1 parent 6b7314e commit 00abcc1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/angular-froala.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,10 @@ value('froalaConfig', {})
141141
scope.$evalAsync(ctrl.updateModelView);
142142
});
143143

144-
scope.$on('$destroy', function () {
144+
element.bind('$destroy', function () {
145145
element.off(ctrl.listeningEvents.join(" "));
146146
element.froalaEditor('destroy');
147+
element = null;
147148
});
148149
};
149150

0 commit comments

Comments
 (0)