๐:1
If you are calling the method showDailyStats after the dailyStatistics you have to use async/await to wait for the data to come into the array before accessing its content.
๐:0
You can assign result of asynchronous call directly in subscribe
without using map
method and then call your method showDailyStats
:
.subscribe( r => {
this.dailyStats = r; //console log prints the whole array all of them!
this.showDailyStats();
}