juniorAngular

What is Angular Lifecycle Hooks?

Updated Apr 28, 2026

Short answer

Lifecycle hooks allow reacting to component lifecycle events.

Deep explanation

Hooks like ngOnInit, ngOnDestroy allow executing logic at different stages.

Real-world example

Fetching data in ngOnInit.

Common mistakes

  • Heavy logic in hooks.

Follow-up questions

  • What is ngOnDestroy?
  • Why lifecycle?

More Angular interview questions

View all →