RouterEvent

class

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. RouterEvents 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);
    });
  }
}

Overview

class RouterEvent {
  constructor(id: number, url: string)
  id: number
  url: string
}

Subclasses

  • GuardsCheckEnd
  • GuardsCheckStart
  • NavigationCancel
  • NavigationEnd
  • NavigationError
  • NavigationStart
  • ResolveEnd
  • ResolveStart
  • RoutesRecognized

Constructor

constructor(id: number, url: string)

Members

id: number

url: string

© 2010–2018 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v5.angular.io/api/router/RouterEvent