I need to remove the currently running Angular application from the website and I was trying to do that by getting rid of the HTML app node. However I discovered recently side effects of doing so i.e. some callbacks that Angular installed were not removed.
What is then the proper way to tear down an Angular 4 application?
The current approach that I'm using doesn't seem to be correct:
function tryRemoveApplicationNode() {
const currentApplicationNode = document.getElementsByTagName('ngk-app')[0];
if (currentApplicationNode) {
const parent = currentApplicationNode.parentNode;
parent.removeChild(currentApplicationNode);
}
}
bootstrap
at prev version?i.eplatformBrowserDynamic().bootstrapModule(your_module)
– Rach Chen Nov 17 '17 at 10:44