This is the archived documentation for Angular v6. Please visit angular.io to see documentation for the current version of Angular.

RouterEvent

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.

See more...

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

Description

Example:

class MyService { constructor(public router: Router, logger: Logger) { router.events.filter(e => e instanceof RouterEvent).subscribe(e => { logger.log(e.id, e.url); }); } }
      
      class MyService {
  constructor(public router: Router, logger: Logger) {
    router.events.filter(e => e instanceof RouterEvent).subscribe(e => {
      logger.log(e.id, e.url);
    });
  }
}
    

Constructor

constructor(id: number, url: string)
      
      constructor(id: number, url: string)
    

Parameters

id

Type: number.

url

Type: string.

Properties

Property Description
id: number Declared in constructor.
url: string Declared in constructor.