Hi, I am trying to retrieve the url id using Angular2.
http:
I played with ActiveRoute inside onInit but with no luck
this.route.queryParams.forEach((params: any) => { console.log("QUERYPARAMS"); console.log(params); });
Also tried to sign up for a route change as follows
this.routeSub = this.route.queryParams.subscribe(params => { console.log(params); console.log(+params['id']); });
but params is just an empty object.
I define a route as a lazy route like this
{ path: item', children: [ { path: ':id', loadChildren: './item/item.module
I think the problem is that I have a header component and a main component that contains a lazy loaded routed child. I am trying to load an identifier inside a header component.
Any idea what is missing?
source share