(respPIN and internalNotes are both of type InternalNotes[])
When the code in encounter.component.ts is set like this:
this.ps.GetInternalNotes(resp.PersonID.toString()).subscribe(respPIN => {
this.internalNotes = respPIN;
});
An ERROR occurs: Error: Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays.
To resolve this issue, I made the following change:
this.ps.GetInternalNotes(resp.PersonID.toString()).subscribe(respPIN => {
for (let index = 0; index < respPIN.length; index++) {
this.internalNotes.push(respPIN[index]);
}
});
After inspecting the data using DevTools debugger, it seems fine (an array of JSON objects with key-value pairs). However, the data does not display in the table of the dialog.
https://i.sstatic.net/cCjbQ.png
This is how the data is sent from that component to the dialog:
this.dialog.open(DialogInternalNotesThreeComponent, {
data: {
data: this.internalNotes
}
});
In dialog-internal-notes-three.component.ts:
this.internalNotes = this.data;
In dialog-internal-notes-three.component.html:
<table>
<tbody>
<tr *ngFor="let note of internalNotes">
<td>{{note.CreateDate}}</td>
<td>{{note.CreatedByText}}</td>
<td>{{note.Note}}</td>
</tr>
</tbody>
</table>
What might be causing this issue?