I'm trying to fetch de data the URL below:
http://storage.googleapis.com/nacleanopenworldprodshards/Nations_cleanopenworldprodeu1.json
I'm using Angular 9, and this is my service.ts:
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
@Injectable({
providedIn: 'root'
})
export class NationsService {
constructor(private http: HttpClient) { }
getData() {
const url = 'http://storage.googleapis.com/nacleanopenworldprodshards/Nations_cleanopenworldprodeu1.json';
return this.http.jsonp(url, 'callback');
}
}
Simple enough, right? but it doesn't work. Because the "API" doesn't have a callback function. I searched a lot in stackoverflow but I did not find how to solve this.
Does anybody knows of a way to get the data using Angular 9?
Thanks you very much!