I just went through the same thing and the example on Angular's (latest) routing example page didn't work for me either. The funny thing is, the code in the tutorial is different from the Plnker that they point to from the tutorial as the LIVE example, and neither works. I finally found an example that works.
I'm using the v3 router (3.0.0-alpha.7) here so make sure that you're using that otherwise i don't know what you'll get.
In your component use the following import
import {Router, ROUTER_DIRECTIVES, ActivatedRoute} from '@angular/router';
Then in your component's constructor inject this:
constructor(private router: Router, private activatedRoute: ActivatedRoute) { }
Then create component variable:
Next, in the ngOnInit do this:
this.paramsSub = this.activatedRoute.params.subscribe(params => {
this.homeId = +params['homeId']; //get your param
call your function that needs the route param
Finally, in ngOnDestroy
ngOnDestroy() {
this.paramsSub.unsubscribe();
}