I've been finding ways to set parameter for this kind of url but I couldn't
http://localhost:9111/v1/companies/{company}/users
where {Company} is the parameter
Anyone have an idea of how to set parameters for this url?
I've been finding ways to set parameter for this kind of url but I couldn't
http://localhost:9111/v1/companies/{company}/users
where {Company} is the parameter
Anyone have an idea of how to set parameters for this url?
You can easily use template literals!
let company = 'google';
return this.http.get(`http://localhost:9111/v1/companies/${company}/users`);
Slight update
Just jumping to this section will probably be faster: https://angular.io/docs/ts/latest/guide/router.html#!#link-parameters-array
original
Reading around this section of the angular docs should explain in detail what you're trying to do: https://angular.io/docs/ts/latest/guide/router.html#!#route-def-with-parameter
In your routing module you define the route in the form ~ { path: 'v1/companies/:companyId/users', component: TheComponent }