I have a get request where I get data from the server and this is how it looks
getStreakConfigurations(){
this.loyaltyPointsService.getStreakConfigurations().subscribe( data => {
this.streakConfiguration = data
console.log(this.streakConfiguration,'check')
}
)
}
when I console.log I get
{id: 8, tenantId: null, days: 2, points: 3, tier: 'MID'}
but when I check the typeof streakConfid.id it says undefined
console.log(typeof this.streakConfiguration.id);
why is it undefined and why is it not a number ?
Let's say you have a service that returns this array of objects (
mockDataArr) and single object(mockDataObj):And then you are using it on controller like below:
Here is the stackblitz example