I have created a Webapp where the user can upload a json. Afterwards it should print out the content of the json. Unfortunately i receive always an empty array.
Here is my JSON:
"06" : {
"fallbackLabel" : "Adelholzener Gastro Classic mit Gas",
"price" : "0.30",
"name" : "0,25l"
},
"07" : {
"fallbackLabel" : "Adelholzener Gastro Classic ohne Kohlensäure",
"price" : "0.30",
"name" : "0,25l"
}
and here is my code:
onFileSelected(event){
this.selectedFile = event.target.files[0];
this.http.get(this.selectedFile).subscribe(data => {
console.log(this.selectedFile.text());
})
}