Angular 2 rc3路由器订阅

Den*_*nko 6 router angular

在angular2 rc1中,我订阅了路线的变化:

this.router.changes.subscribe(
() => {
    console.log(this.location.path());
});
Run Code Online (Sandbox Code Playgroud)

我如何订购angular2 rc3中的路线?router.changes已经不存在了.

Gün*_*uer 6

constructor(router:Router) {
  router.events.subscribe(event:Event => {
    if(event instanceof NavigationStart) {
    }
    // NavigationEnd
    // NavigationCancel
    // NavigationError
    // RoutesRecognized
  }
}
Run Code Online (Sandbox Code Playgroud)

要么

constructor(router:Router) {
  router.events.forEach(event:Event => {
Run Code Online (Sandbox Code Playgroud)