Currently I'm trying to create an Angular app where the user can receive a specific URL : e.g /answer/1234d1fjs8
and whenever "answer" is in the URL the routing should open the component "answer".
I've done this with routing and redirect but sadly the app cuts out the id (1234d1fjs8) and the url after routing is simply /answer
.
I either need to safe the part of the url after the /answer
in a variable/service or redirect without cutting the url. I'd prefer the redirect without cutting.
Routes from app-routing.module.ts :
{ path: 'answer', component: SummaryComponent},
{ path: 'answer',redirectTo:'/answer',pathMatch: 'prefix'}