How do I get the RouteParams from a parent component?
App.ts
:
@Component({
...
})
@RouteConfig([
{path: \'/\', component: HomeCompo
In RC6, router 3.0.0-rc.2 (probably works in RC5 as well), you can take route params from the URL as a snapshot in case that params won't change, without observables with this one liner:
this.route.snapshot.parent.params['username'];
Don't forget to inject ActivatedRoute as follows:
constructor(private route: ActivatedRoute) {};