Home:ALL Converter>Angular routing redirect without cutting the url

Angular routing redirect without cutting the url

Ask Time:2019-07-08T17:44:48         Author:user9491184

Json Formatter

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'}

Author:user9491184,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/56932248/angular-routing-redirect-without-cutting-the-url
yy