linkRouterEvent
npm Package | @angular/router |
---|---|
Module | import { RouterEvent } from '@angular/router'; |
Source | router/src/events.ts |
Base for events the Router goes through, as opposed to events tied to a specific
Route. RouterEvent
s will only be fired one time for any given navigation.
Example:
class MyService {
constructor(public router: Router, logger: Logger) {
router.events.filter(e => e instanceof RouterEvent).subscribe(e => {
logger.log(e.id, e.url);
});
}
}
linkOverview
class RouterEvent {
constructor(id: number, url: string)
id: number
url: string
}
linkSubclasses
-
GuardsCheckEnd
-
GuardsCheckStart
-
NavigationCancel
-
NavigationEnd
-
NavigationError
-
NavigationStart
-
ResolveEnd
-
ResolveStart
-
RoutesRecognized