I got 2 web applications A and B. The web Application B is the Angular 6 base.
In web application A, it got a link which is referring to B with query string like http://B/receipt?referencenumber=11111&title=test&description=sdfsd.
In web application B, I have define route like below.
{ path: 'receipt/:referencenumber/:title/:description', component: ReceiptComponent},
{ path: '', component: HomeComponent, pathMatch: 'full'},
{ path: 'home', component: HomeComponent},
{ path: 'error', component: ErrorComponent },
{ path: '**', component: ErrorComponent, data: { error: 404 } }
Issue:
if web application A, use the link http://B/receipt?referencenumber=11111&title=test&description=sdfsd, it would be redirected to 404 error page in web applicaiton B.
Anyone got Idea here? I have tried to modify the route in web application to { path: 'receipt/:referencenumber', component: ReceiptComponent}, and change the linke in web application A to http://B/receipt?referencenumber=11111, it still redirect to 404.
Moreover, I have tried route below with the optional query parameters, it is still not working. (Ref: Send data through routing paths in Angular) { path: 'receipt', component: ReceiptComponent}
Update
After I remove the error page, I found that the url is automatically encoded, it become http://B/receipt%3Freferencenumber%3D123123 not sure why also?