Skip to content

Latest commit

 

History

History
59 lines (35 loc) · 2.24 KB

File metadata and controls

59 lines (35 loc) · 2.24 KB
title ion-router-outlet

import Props from '@ionic-internal/component-api/v7/router-outlet/props.md'; import Events from '@ionic-internal/component-api/v7/router-outlet/events.md'; import Methods from '@ionic-internal/component-api/v7/router-outlet/methods.md'; import Parts from '@ionic-internal/component-api/v7/router-outlet/parts.md'; import CustomProps from '@ionic-internal/component-api/v7/router-outlet/custom-props.md'; import Slots from '@ionic-internal/component-api/v7/router-outlet/slots.md';

import EncapsulationPill from '@components/page/api/EncapsulationPill';

The router outlet behaves in a similar way to Angular's built-in router outlet component and Vue's router view component, but contains the logic for providing a stacked navigation, and animating views in and out.

Although router outlet has methods for navigating around, it's recommended to use the navigation methods in your framework's router.

Life Cycle Hooks

Routes rendered in a Router Outlet have access to specific Ionic events that are wired up to animations

Event Name Trigger
ionViewWillEnter Fired when the component routing to is about to animate into view.
ionViewDidEnter Fired when the component routing to has finished animating.
ionViewWillLeave Fired when the component routing from is about to animate.
ionViewDidLeave Fired when the component routing to has finished animating.

These event tie into Ionic's animation system and can be used to coordinate parts of your app when a Components is done with its animation. These events are not a replacement for your framework's own event system, but an addition.

For handling Router Guards, the older ionViewCanEnter and ionViewCanLeave have been replaced with their framework specific equivalent. For Angular, there are Router Guards.

Properties

Events

Methods

CSS Shadow Parts

CSS Custom Properties

Slots