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
@paramid
number
@paramurl
string
@paramerror
any
@paramtarget
RouterStateSnapshot | undefinedThe 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.
@returns
NavigationError
error
anyid
numberA unique ID that the router assigns to every router navigation.
url
stringThe URL that is the destination for this navigation.