In my application the route is something like this :-
{ path: 'route-a', component: ComponentA, children : [
{ path: ':param-b', component: ChildComponentB, children : [
{ path: ':param-c', component: ChildComponentC }
]}
]},
Now in my ComponentA I am trying to subscribe to child param to get param-b
this.routefirstChild$ = this.route.firstChild.params.subscribe($routefirstChild => {
console.log($routefirstChild, '$routefirstChild');
});
Now when I navigate to example.com/route-a I am getting this.route.firstChild is null error.
But if I navigate to example.com/route-a/1234 the param is passed. Which observable to have to subscribe that doesn't trigger an error but would pass the child params when the route is activated.