This article briefly summarizes the changes in the life cycle naming in the version of Ionic 2, as well as the interpretation of each event.
The naming and use of the Ionic lifecycle was explained in the previous course, but after the Ionic 2 update to version 30, the framework has changed the global naming of the life cycle, so this article simply collates the new life cycle events and descriptions below.
The Official document address is here.
Event name |
Event Description |
ionviewloaded |
The page loads and fires. This event occurs when the page is created into the DOM and is executed only once. If the page is cached (ionic is cached by default), the event is not triggered again. Some events in this event can be placed to initialize the page. |
Ionviewwillenter |
The event that will be executed when a page becomes the current active page. |
Ionviewdidenter |
Enters a page and becomes the current activation page, which is executed whether it is entered after the first entry or the cache. |
Ionviewwillleave |
The event that will be executed when the page is not currently active after it is left. |
Ionviewdidleave |
An event that executes when the page finishes leaving the page and becomes a page that is not currently active. |
Ionviewwillunload |
Events that are executed before the page is destroyed and there are elements removed from the page. |
Ionviewdidunload |
Events that are executed after the page is destroyed and there are elements removed from the page. |
Name change and description of life cycle in Ionic 2