W3cubDocs

/Angular

NavigationError

An event triggered when a navigation fails due to an unexpected error.

API

class NavigationError extends RouterEvent {
  constructor(id: number, url: string, error: any, target?: RouterStateSnapshot | undefined): NavigationError;
  readonly type: EventType.NavigationError;
  override error: any;
  override id: number;
  override url: string;
}

constructor

NavigationError
@paramidnumber
@paramurlstring
@paramerrorany
@paramtargetRouterStateSnapshot | undefined

The target of the navigation when the error occurred.

Note that this can be undefined because an error could have occurred before the RouterStateSnapshot was created for the navigation.

@returnsNavigationError

error

any

id

number

A unique ID that the router assigns to every router navigation.

url

string

The URL that is the destination for this navigation.

Super-powered by Google ©2010–2025.
Code licensed under an MIT-style License. Documentation licensed under CC BY 4.0.
https://angular.dev/api/router/NavigationError