May 2018
Intermediate to advanced
512 pages
11h 3m
English
To be able to use the getCurrentWeather function in the CurrentWeather component, you need to inject the service into the component:
src/app/current-weather/current-weather.component.tsconstructor(private weatherService: WeatherService) { }
src/app/current-weather/current-weather.component.tsngOnInit() { this.weatherService.getCurrentWeather('Bethesda', 'US') .subscribe((data) => this.current = data)}
Fair warning, do not expect this code to be working just yet. You should see ...
Read now
Unlock full access