Advertisement
Guest User

Untitled

a guest
Apr 21st, 2018
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. export class AppComponent {
  2. title = 'MyCompany Inc.';
  3. now = Date.now();
  4. weather: string;
  5. temp: string;
  6. city: string;
  7.  
  8. constructor(private httpS:HttpService){console.log('created service...')}
  9.  
  10. ngOnInit() {
  11. this.httpS.getWeatherInfo().subscribe((response) => {
  12. console.log(response);
  13. this.temp = response.current_observation.temp_c;
  14. this.weather = response.current_observation.weather;
  15. this.city = response.current_observation.display_location.full;
  16. });
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement