Skip to content

Instantly share code, notes, and snippets.

@thisiszoaib
Created July 9, 2020 11:33
Show Gist options
  • Select an option

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

Select an option

Save thisiszoaib/e9367c5f2fa8ec199c9abb9dfdcc1483 to your computer and use it in GitHub Desktop.
Weather 3
@Injectable({ providedIn: "root" })
export class WeatherService {
constructor(private http: HttpClient) {}
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);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment