I have nested JSON objects. I want to show nested data along with the main item but it's not showing the values.
ts code
productAttributeItems: any[] = [];
getProductAttributeItems() {
this.productAttributeItems = this.productAttributeItems.filter(b => b.ProductId == 5);
this.productService.getProductAttributesItems(5).subscribe(x => {
Object.assign(this.productAttributeItems, x);
console.log(x);
});
}
Html
<table class="table table-hover">
<thead>
<tr>
<th>Attribute Name</th>
<th>Name</th>
<th>Price</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let attItems of productAttributeItems">
<td>{{ attItems.Name }}</td>
<td>{{ attItems.ProductAttributeItems?.MasterProductAttributeItem?.Name }}</td>
<td style="width: 40%; white-space: nowrap">{{ attItems.ProductAttributeItems.PriceAdjustment }}</td>
</tr>
</tbody>
</table>