Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export class AppComponent {
- title = 'MyCompany Inc.';
- now = Date.now();
- weather: string;
- temp: string;
- city: string;
- constructor(private httpS:HttpService){console.log('created service...')}
- ngOnInit() {
- this.httpS.getWeatherInfo().subscribe((response) => {
- console.log(response);
- this.temp = response.current_observation.temp_c;
- this.weather = response.current_observation.weather;
- this.city = response.current_observation.display_location.full;
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement