-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
On $destroy does not clean up the 3.0.5 editor #218
Comments
Yes, I reported this back in #211, but nothing was done to it. AngularJS froala has been in an unusable state for the past three months or so. |
I also encountered this issue - did anyone of you find a workaround for this? |
…rs (froala#218) The scope will still be kept alive for reasons unknown - but will not throw errors.
Dirty workaround for scope not getting cleaned up and generating errors (froala#218)
Dirty workaround for scope not getting cleaned up and generating errors (froala#218)
I ended up adding this commit: DigiExam@538ed12 Not an especially nice solution - but have spent a few hours too many on this so I was just glad to get rid of the errors. |
@robinwassen did not try to do any other workaround than the ones provided above. We currently use the controller in location where the impact can be limited at the moment. |
In a normal scenario where you go from edit mode to presentation mode and then back to edit mode, the second time you go to edit mode by using ng-if. You will get an
error showing in the console, this is because the options used to create a new froala editor the second time around has a reference to the previous editor create in the ctrl.options.froalaEditor.
To fix it it must be cleared when the editor is destroyed on initialized.
Then you might experience the next issue which is element is null when reaching
element.bind('$destroy'
to work around this issue pass the element as an argument to the ctrl.initListeners function and it seems to be working.And also found, one reason why froala has bad performance is most likely because of the lack of cleanup when the controller is destroyed. Second time the controller is initlized the
ctrl.options.events.initialized
is called twice, third time three times etc.I would say that angular-froala is not production ready and should be used with care until these basic issues have been solved.
The text was updated successfully, but these errors were encountered: