i was able to finish the json tutorial from this video:
however, when i try to change the json-file to a json-file of my own (or even download the json-file from the tut an upload it to my server) it dosn’t display anything then:
→ so: why is:
loadData(){
let data:Observable;
data = this.http.get(‘https://jsonplaceholder.typicode.com/posts’);
data.subscribe(result => {
this.items = result;
})
}
working,
but if i copy the jsonfile to: “http://mydomain.com/xyz.json”
loadData(){
let data:Observable;
data = this.http.get(‘http://mydomain.com/xyz.json’);
data.subscribe(result => {
this.items = result;
})
}
isn’t working anymore!??
how can i fix this? / how do i save the jsonfile: ‘https://jsonplaceholder.typicode.com/posts to my server to change the data/read it from my server? thx