I have been looking for a way to pass query parameters into an API call with the new HttpClientModule
\'s HttpClient
and have yet to find a solution
If you have an object that can be converted to {key: 'stringValue'}
pairs, you can use this shortcut to convert it:
this._Http.get(myUrlString, {params: {...myParamsObject}});
I just love the spread syntax!
search property of type URLSearchParams in RequestOptions class is deprecated in angular 4. Instead, you should use params property of type URLSearchParams.