From 538ed12cca88aa139e9790d80ddf5a3e7ea05b87 Mon Sep 17 00:00:00 2001 From: Robin Andersson Date: Thu, 5 Dec 2019 15:40:18 +0100 Subject: [PATCH] Dirty workaround for scope not getting cleaned up and generating errors (#218) The scope will still be kept alive for reasons unknown - but will not throw errors. --- src/angular-froala.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/angular-froala.js b/src/angular-froala.js index a54320a..d8fa6e3 100644 --- a/src/angular-froala.js +++ b/src/angular-froala.js @@ -126,6 +126,10 @@ }; ctrl.initListeners = function() { + if (!element) { + return; + } + if (ctrl.options.immediateAngularModelUpdate) { ctrl.froalaEditor.events.on('keyup', function() { scope.$evalAsync(ctrl.updateModelView);