Search⌘ K
AI Features

Lifecycle Events

Explore how to use Ionic-specific lifecycle events alongside Angular hooks to manage page transitions and component behavior in Ionic apps. This lesson helps you understand when pages load and unload to improve navigation, data handling, and resource cleanup within your applications.

Ionic lifecycle events

We can control what happens within our app before, during, and after pages have loaded with the following Ionic-specific navigation lifecycle events:

  • ionViewWillEnter: event runs when the requested page is about to enter and become active
  • ionViewDidEnter: event runs when the page has completed entering and is now the active page
  • ionViewWillLeave: event runs when the page is about to leave and no longer be the active page
  • ionViewDidLeave: event runs when the previously active page has completed leaving
...