# ngOnDestroy

*noun*

say it: **“EN-JEE on dih-STROY”** **/ˌɛn ˈdʒiː ɒn dɪˈstrɔɪ/**

The Angular lifecycle method called just before a component is removed, used to clean up.

## What is **ngOnDestroy** in Angular?

**ngOnDestroy** — The lifecycle method Angular calls just before it removes a component from the page. Use it to stop timers and anything else that would keep running after the component is gone.

```typescript
export class Countdown implements OnDestroy {
  private readonly timer = setInterval(() => this.tick(), 1000);
  ngOnDestroy(): void {
    clearInterval(this.timer);
  }
  private tick(): void { /* ... */ }
}
```

## In a sentence

- “The countdown's timer is cleared in **ngOnDestroy**, so it stops when you leave the page.”

Level: Apprentice · [More Angular terms at this level](https://www.ask-codey.com/glossary?category=angular&level=2)

Updated: November 9, 2026

Source: https://www.ask-codey.com/glossary/ngondestroy
