When updating or when moving away from the current page, ngOnDestroy will not be called. The application will simply be destroyed by the browser.
Only when Angular2 removes a component from the DOM because you are leaving or you are calling destroy() on a dynamically created component is ngOnDestroy() called.
You can listen to beforeunload and unload yourself if you need some action before the application is destroyed by the browser.
see also
Günter zöchbauer
source share