Upon running console.log, the data output appears as follows:
{TotalPendingResponseCount: 0, TotalRequestSendCount: 1, TotalRequestReceivedCount: 1, TotalRequestRejectCount: 3}
To store this information, I am holding it in an array:
userData : arrayResponseCount[];
To retrieve the result:
this.dataservice.getData(Url).
subscribe((res: any) =>
{ this.userData = res });
}
The structure of my arrayResponseCount class is:
class arrayResponseCount {
constructor(public TotalRequestSendCount: string, public TotalPendingResponseCount: string,
public TotalRequestRejectCount: string, public TotalRequestReceivedCount: string
){}
}
Now, for binding the value in HTML, I am using the syntax:
{{userData.TotalRequestSendCount}}
However, this results in an exception being thrown: ERROR TypeError: Cannot read property 'TotalRequestSendCount' of undefined.
Any insights on how to address this issue?