The output of my data in console.log:
{TotalPendingResponseCount: 0, TotalRequestSendCount: 1, TotalRequestReceivedCount: 1, TotalRequestRejectCount: 3}
To capture these information I am holding it in array:
userData : arrayResponseCount[];
To get the result:
this.dataservice.getData(Url).
subscribe((res: any) =>
{ this.userData = res });
}
And my arrayResponseCount class is:
class arrayResponseCount {
constructor(public TotalRequestSendCount: string, public TotalPendingResponseCount: string,
public TotalRequestRejectCount: string, public TotalRequestReceivedCount: string
){}
}
Now I need to bind the value in HTML. For this I am using the syntex is
{{userData.TotalRequestSendCount}}
But it thrown the exception i.e. ERROR TypeError: Cannot read property 'TotalRequestSendCount' of undefined.
Do you have any idea for this?