Hi,
I want to get external json file from a webserver ( http://www.debsociety.nl/wp-content/data.json)
The code I made now is :
@Injectable({
providedIn: ‘root’
})
export class SymposiumData {
data: any;
constructor(public http: HttpClient, public user: UserData) {}
load(): any {
if (this.data) {
return of(this.data);
} else {
return this.http
.get(’/assets/symposium/data.json’)
.pipe(map(this.processData, this));
}
}
But everything I tried I still get the data from /assets/symposium/data.json (local).
Can somebody help me: what did I do wrong or what will be the right code.
Thanks in advance.
Cheers, erik