To avoid future mistakes in returning the unintended type of data from your service, you need to update the getCurrentWeather function to define the return type to be Observable<ICurrentWeather> and import the Observable type, as shown:
src/app/weather/weather.service.tsimport { Observable } from 'rxjs'import { ICurrentWeather } from '../interfaces'...
export class WeatherService { ... getCurrentWeather(city: string, country: string): Observable<ICurrentWeather> { } ...}
Now, VS Code will let you know that Type Observable<ICurrentWeatherData> is not assignable to type Observable<ICurrentWeather>:
- Write a transformation function named transformToICurrentWeather that can convert ICurrentWeatherData to ...