Cookies concent notice

This site uses cookies from Google to deliver its services and to analyze traffic.
Learn more
Skip to main content
This site is no longer updated.Head to Angular.devHome
/

This is the archived documentation for Angular v17. Please visit angular.dev to see this page for the current version of Angular.

NavigationSkipped

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.