Currently I'm using this routing setup for my app:
{
path: ':group',
component: ArticleListComponent,
children: [{
path: ':subgroup',
component: ArticleListComponent,
children: [{
path: ':chapter',
component: ArticleListComponent,
children: [{
path: ':section',
component: ArticleListComponent,
children: [
]
}
]
}
]
}
]
},
I use the same component for listing articles because the template and code will not change, but I want to use the url for filtering these articles. The app should work with routing params instead of get params. With these params I want to call an API to get the articles which belong to this url: /group1/subgroup1/chapter1/section1.
The problem is that I only get these params with the following code:
const params = this.route.snapshot.params;
// {group: "group1"}
const params = this.route.parent.snapshot.params;
// {}
const params = this.route.firstChild.snapshot.params;
// {group: "group1", subgroup: "subgroup1"}
How can I get all these params at once?