Is it possible to display a different component in Angular routing based on a condition in the Routing file? For example, if mineType is equal to "mino", can I navigate to another component instead of the one declared in the Routing?
Should I use Child routes or maybe incorporate an if() statement in the TypeScript file?
Thank you.
Routing
const minRoutes: Routes = [
{
path: min/:id/:mineType,
component: MinComponent,
}
]
ts.file
getDataFromRoute() {
this.route.paramMap.subscribe((params:Params) => {
this.id = params.get('id');
this.type = params.get('mineType');
}
}