I am trying to pass parameters to one component in this format www.domain.com?param=value
, but Angular keep sending parameters like this www.domain.com;param=
Angular provides three types of parameters:
The look of the URL and the syntax for navigating using the parameters is different depending on which type of parameter you want to use.
If you want to use the "?" style, then you want the query parameters.
Query Parameters:
NOT this:
{path: 'shop/new/:id', component: NewShopComponent, canActivate: [AuthManager]},
RATHER this:
{path: 'shop/new', component: NewShopComponent, canActivate: [AuthManager]},
Then you navigate to the route like this:
this.router.navigate(['/shops'],
{
queryParams: { id: id }
}
);
If you want more information on how to use routing ... check this out: https://app.pluralsight.com/library/courses/angular-routing/table-of-contents