In the past, my method of working with JSON looked like this:
this.http.get('http://localhost:3000/SumOfDipVolume').subscribe(res => {
for (let dipVolume of res['result']) {
// some code
});
However, I have now realized that I no longer want to access the result object, as my JSON structure does not include it. Here is an example of my current JSON file:
[
{
"Title": "DYNAMIC DISEL 50PPM",
"UpValue": "122,196",
"DownValue": "-148,740.83",
"Procentage": "45.10%"
},
{
"Title": "DYNAMIC UNLEADED 95",
"UpValue": "121,905",
"DownValue": "-285,527.35",
"Procentage": "29.92%"
}
]
Now I need to use something like this: for (let dipVolume of res) {
but Angular is giving me the error:
Type object is not an array type or a string type.
How can I iterate through this?