I have an HTML component:
<p-table [value]="results1" [tableStyle]="{ 'min-width': '30rem' }">
<ng-template pTemplate="header" let-user>
<tr>
<th>Groups for {{user.displayName}} ({{count1}})</th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-ad>
<tr>
<td>{{results1}}</td>
</tr>
</ng-template>
</p-table>
My Array (results1) is made up of the following:
{
"displayName": "Joe Bloggs",
"adgroups": [
"All Support Information Distribution",
"All-IT",
"ASH-RDS",
"AZCS-PRTG-Users",
"CORE-IT",
"DEFENDER_TFA_AUTHENTICATED_USERS",
"device.approvals",
]
}
Errors:
cannot read properties of undefined (reading 'displayName')
The table body gives this error:
ROR Error: NG0901
Any Hell would be great
I've tried to put the array in it's own array with no other data and I get the same error, I'm fairly new to angular and primeng I have done this a similar way before and it's worked, I've not used an array for the table body data before so I'm guessing that's where I'm going wrong