I'm encountering an issue with extracting a parameter from a URL in my form. Initially, the form linked a customer to a product using one parameter. Now, we have added another parameter to be included in the URL, but I am unable to retrieve it.
What could I be doing incorrectly? Any assistance is appreciated!
URL: http://localhost:4200/check/98712?Id=803
I can successfully extract the first parameter "98712", but not the Id.
In my app.module file:
RouterModule.forRoot([
{ path: 'check/:cust', component: CheckComponent},
I attempted adding Id there, but it did not yield results.
Even in my Check component, although I am able to extract the customer, the Id remains empty.
this.customer = this.route.snapshot.paramMap.get('cust');
this.Ids = this.route.snapshot.paramMap.get('Id'); //Ids since it could be several, hence the addition of Id in the URL
My routes in app-routing:
const routes: Routes = [
{ path: '', redirectTo: 'ms', pathMatch: 'full' },
{ path: 'ms', component: CheckComponent },
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }
Please let me know if you require more code snippets.