Skip to main content
added 6 characters in body
Source Link
Pardeep Jain
  • 86.9k
  • 38
  • 172
  • 220

In Beta 17 the URL was passed to the subscriber like so this.router.subscribe(function(url){ if( typeof url !== "undefined" ) { if( url.length > 0 ) { console.log('Handle router changes /' + url); } } }.bind(this));

this.router.subscribe(function(url){ if( typeof url !== "undefined" ) { if( url.length > 0 ) { console.log('Handle router changes /' + url); } } }.bind(this)); 

In rc 1 I believe you have to subscribe to the router.changes emitter however no parameters are passed? this.router.changes.subscribe(function(url){ // url is always null }.bind(this)); Is there some other way to subscribe to router changes in rc1

In Beta 17 the URL was passed to the subscriber like so this.router.subscribe(function(url){ if( typeof url !== "undefined" ) { if( url.length > 0 ) { console.log('Handle router changes /' + url); } } }.bind(this));

In rc 1 I believe you have to subscribe to the router.changes emitter however no parameters are passed? this.router.changes.subscribe(function(url){ // url is always null }.bind(this)); Is there some other way to subscribe to router changes in rc1

In Beta 17 the URL was passed to the subscriber like so

this.router.subscribe(function(url){ if( typeof url !== "undefined" ) { if( url.length > 0 ) { console.log('Handle router changes /' + url); } } }.bind(this)); 

In rc 1 I believe you have to subscribe to the router.changes emitter however no parameters are passed? this.router.changes.subscribe(function(url){ // url is always null }.bind(this)); Is there some other way to subscribe to router changes in rc1

Source Link
Greg
  • 1.1k
  • 1
  • 9
  • 9

Angular 2 rc 1 router changes subscribe does not receive any parameters

In Beta 17 the URL was passed to the subscriber like so this.router.subscribe(function(url){ if( typeof url !== "undefined" ) { if( url.length > 0 ) { console.log('Handle router changes /' + url); } } }.bind(this));

In rc 1 I believe you have to subscribe to the router.changes emitter however no parameters are passed? this.router.changes.subscribe(function(url){ // url is always null }.bind(this)); Is there some other way to subscribe to router changes in rc1