Skip to content
This repository has been archived by the owner on Jan 23, 2022. It is now read-only.

Commit

Permalink
fix(docs): only $destroy existing embed rootScope #179 #183
Browse files Browse the repository at this point in the history
  • Loading branch information
m7r committed May 2, 2016
1 parent 25f573b commit 47c83b5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/templates/js/angular-bootstrap-prettify.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,12 @@ directive.ngEmbedApp = ['$templateCache', '$browser', '$rootScope', '$location',
});

element.bind('$destroy', function() {
deregisterEmbedRootScope();
embedRootScope.$destroy();
if (deregisterEmbedRootScope) {
deregisterEmbedRootScope();
}
if (embedRootScope) {
embedRootScope.$destroy();
}
});

element.data('$injector', null);
Expand Down

0 comments on commit 47c83b5

Please sign in to comment.