Last active
May 19, 2019 11:11
-
-
Save PyroGenesis/b930283fe1316b7ed37ae0387fe40369 to your computer and use it in GitHub Desktop.
Angular request with Parameters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// GET request with params | |
GET_with_params(): Observable<any> { | |
const URL = 'YOUR_URL_HERE'; | |
const params = new HttpParams() | |
.set('param_key', 'param_value') | |
.set('param_key2', 'param_value2'); | |
return this.httpClient.get(URL, { params: params }); // returns an Observable | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment