Skip to content

Instantly share code, notes, and snippets.

@thisiszoaib
Last active July 9, 2020 11:38
Show Gist options
  • Select an option

  • Save thisiszoaib/54e5a617c24e3648fe93cfbc5fbeaf3d to your computer and use it in GitHub Desktop.

Select an option

Save thisiszoaib/54e5a617c24e3648fe93cfbc5fbeaf3d to your computer and use it in GitHub Desktop.
Weather 12
getWeatherForCity(city: string): Observable<any> {
const path = `https://api.openweathermap.org/data/2.5/weather?q=${city}&units=metric&APPID=695ed9f29c4599b7544d0db5c211d499`;
return this.http.get(path).pipe(
map(data => ({
...data,
image: `http://openweathermap.org/img/wn/${data.weather[0].icon}@2x.png`
})),
delay(500)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment