Skip to content

Instantly share code, notes, and snippets.

@surmon-china
Created December 2, 2016 09:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save surmon-china/0a51aa8e30637f249ea1cc6d1588b1a1 to your computer and use it in GitHub Desktop.
Save surmon-china/0a51aa8e30637f249ea1cc6d1588b1a1 to your computer and use it in GitHub Desktop.
// Parameters obj-
let params: URLSearchParams = new URLSearchParams();
params.set('appid', StaticSettings.API_KEY);
params.set('cnt', days.toString());
//Http request-
return this.http.get(StaticSettings.BASE_URL, {
search: params
}).subscribe(
(response) => this.onGetForecastResult(response.json()),
(error) => this.onGetForecastError(error.json()),
() => this.onGetForecastComplete()
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment