OnDestroy

Stable

Class

What it does

Lifecycle hook that is called when a directive, pipe or service is destroyed.

How to use

.

  1. @Component({selector: 'my-cmp', template: `...`})
  2. class MyComponent implements OnDestroy {
  3. ngOnDestroy() {
  4. // ...
  5. }
  6. }

Class Overview

class OnDestroy {
ngOnDestroy() : void

}

Class Description

Class Details

exported from @angular/core/index, defined in @angular/core/src/metadata/lifecycle_hooks.ts