W3cubDocs

/Angular

NavigationSkipped

class final

An event triggered when a navigation is skipped. This can happen for a couple reasons including onSameUrlHandling is set to ignore and the navigation URL is not different than the current state.

class NavigationSkipped extends RouterEvent {
  constructor(id: number, url: string, reason: string, code?: NavigationSkippedCode)
  type: EventType.NavigationSkipped
  reason: string
  code?: NavigationSkippedCode

  // inherited from router/RouterEvent
  constructor(id: number, url: string)
  id: number
  url: string
}

Constructor

constructor(id: number, url: string, reason: string, code?: NavigationSkippedCode)

Parameters
id number
url string
reason string

A description of why the navigation was skipped. For debug purposes only. Use code instead for a stable skipped reason that can be used in production.

code NavigationSkippedCode

A code to indicate why the navigation was skipped. This code is stable for the reason and can be relied on whereas the reason string could change and should not be used in production.

Optional. Default is undefined.

Properties

Property Description
type: EventType.NavigationSkipped Read-Only
reason: string Declared in Constructor

A description of why the navigation was skipped. For debug purposes only. Use code instead for a stable skipped reason that can be used in production.

code?: NavigationSkippedCode Read-Only Declared in Constructor

A code to indicate why the navigation was skipped. This code is stable for the reason and can be relied on whereas the reason string could change and should not be used in production.

© 2010–2023 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://angular.io/api/router/NavigationSkipped