OnDestroy

Stable

Interface

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. }

Interface Overview

interface OnDestroy {
ngOnDestroy() : void

}

Interface Description

Interface Details

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