Skip to content

Commit 4e3bff8

Browse files
Merge pull request #125 from florinpopescu/master
Fixed memory leak on event
2 parents 1f1b57f + 00abcc1 commit 4e3bff8

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)