In angular2 rc1 I subscribe for a change of route:
this.router.changes.subscribe( () => { console.log(this.location.path()); }); How I can subscribe to change route in angular2 rc3? router.changes already doesn't exists.
In angular2 rc1 I subscribe for a change of route:
this.router.changes.subscribe( () => { console.log(this.location.path()); }); How I can subscribe to change route in angular2 rc3? router.changes already doesn't exists.
constructor(router:Router) { router.events.subscribe(event:Event => { if(event instanceof NavigationStart) { } // NavigationEnd // NavigationCancel // NavigationError // RoutesRecognized } } or
constructor(router:Router) { router.events.forEach(event:Event => {