Cześć, wykonuję zapytanie do API pogodowego o poniższej treści:
public getCurrentWeather() {
this._searchUrlCurrent = this._searchUrlCurrent + this.city + this.apikey;
return this._http.get<City>(this._searchUrlCurrent).pipe(
map((data: any) => {
return data;
}));
}
I następnie w komponencie:
ngOnInit() {
this.httpService.getCurrentWeather()
.subscribe((data: any) => {
this.city = data;
});
}
I o ile to wszystko działa za pierwszym wysłaniem zapytania, tak za drugim mam następujący komunikat;
https://imgur.com/iPKvBHp
Czy ktoś mógłby mi doradzić jak zwalczyć ten błąd?
Angular wersja 7.