What it does
Lifecycle hook that is called when a directive, pipe or service is destroyed.
How to use
.
Class Overview
Class Description
ngOnDestroy
callback is typically used for any custom cleanup that needs to occur when the
instance is destroyed.
exported from @angular/core/index, defined in @angular/core/src/metadata/lifecycle_hooks.ts