Is there a way to handle recursively unknown exact number of router parameters?
For example:
We have products categories, which can have su
Possible solution with componentless routes: in routes config
{
path: 'categories/:id', children: [
{path: '**', component: SubcategoriesListComponent}
]
}
in component file:
export class SubcategoriesListComponent {
constructor(aroute: ActivatedRoute) {
aroute.url.subscribe((data) => {
console.log('params ', data); //contains all the segments so put logic here of determining what to do according to nesting depth
});
}
}
Here is the output example (i tested on my project ErrorComponent so don't be confused)