TylerGarlick / angular-redactor

Redactor WYSIWYG directives for redactor editor
MIT License
208 stars 83 forks source link

Destroy editor when scope is destroyed #39

Open benfoster opened 9 years ago

benfoster commented 9 years ago

Currently the editor is not destroyed when the directive scope is destroyed. This is a problem for us as when switching between editors in our application, redactor just get's re-inited/rendered each time it is selected. Fix:

        scope.$on('$destroy', function () {
          if (angular.isDefined(editor)) {
            $_element.redactor('core.destroy');
          }
        });
TylerGarlick commented 9 years ago

Can you do a pull request for that?

JeromeLam commented 9 years ago

@TylerGarlick PR #37 does exactly that, although coded differently.