Navigation
Information about a navigation operation. Retrieve the most recent navigation object with the Router.getCurrentNavigation() method .
id
numberThe unique identifier of the current navigation.
initialUrl
UrlTreeThe target URL passed into the Router#navigateByUrl() call before navigation. This is
the value before the router has parsed or applied redirects to it.
extractedUrl
UrlTreeThe initial target URL after being parsed with UrlHandlingStrategy.extract().
finalUrl
UrlTree | undefinedThe extracted URL after redirects have been applied.
This URL may not be available immediately, therefore this property can be undefined.
It is guaranteed to be set after the RoutesRecognized event fires.
trigger
NavigationTriggerIdentifies how this navigation was triggered.
extras
NavigationExtrasOptions that controlled the strategy used for this navigation.
See NavigationExtras.
abort
() => voidAborts the navigation if it has not yet been completed or reached the point where routes are being activated. This function is a no-op if the navigation is beyond the point where it can be aborted.
Description
Information about a navigation operation. Retrieve the most recent navigation object with the Router.getCurrentNavigation() method .
- id : The unique identifier of the current navigation.
- initialUrl : The target URL passed into the
Router#navigateByUrl()call before navigation. This is the value before the router has parsed or applied redirects to it. - extractedUrl : The initial target URL after being parsed with
UrlSerializer.extract(). - finalUrl : The extracted URL after redirects have been applied.
This URL may not be available immediately, therefore this property can be
undefined. It is guaranteed to be set after theRoutesRecognizedevent fires. - trigger : Identifies how this navigation was triggered.
-- 'imperative'--Triggered by
router.navigateByUrlorrouter.navigate. -- 'popstate'--Triggered by a popstate event. -- 'hashchange'--Triggered by a hashchange event. - extras : A
NavigationExtrasoptions object that controlled the strategy used for this navigation. - previousNavigation : The previously successful
Navigationobject. Only one previous navigation is available, therefore this previousNavigationobject has anullvalue for its ownpreviousNavigation.