I am very new to angular and I am assigned to a task where I want to get data from an API and iterate and display it in a chart. My angular version is 6.
This is the response JSON format, It is a list of objects-
[
{
"counts": 0,
"time": "00:00:00"
},
{
"counts": 0,
"time": "01:00:00"
},
{
"time": "02:00:00",
"counts": 1
},
{
"counts": 7,
"time": "03:00:00"
}
]
To fetch that
data : [];
this.service.getPaymentDistributionData()
.subscribe((res) => {
console.log(res)
})
How can I get each count and time and print?
Thanks,