RouterEvent • Angular
Base for events the router goes through, as opposed to events tied to a specific route. Fired one time for any given navigation.
API
class RouterEvent { constructor(id: number, url: string): RouterEvent; override id: number; override url: string;}
constructor
RouterEvent@paramidnumber
A unique ID that the router assigns to every router navigation.
@paramurlstring
The URL that is the destination for this navigation.
id
numberA unique ID that the router assigns to every router navigation.
url
stringThe URL that is the destination for this navigation.
Description
Base for events the router goes through, as opposed to events tied to a specific route. Fired one time for any given navigation.
The following code shows how a class subscribes to router events.