Html 用角度8上的值填充比较表
我需要用这些值填写表格属性,但我不知道如何输入某些值在相应的列中 我的模型数据有:Html 用角度8上的值填充比较表,html,node.js,angular,typescript,Html,Node.js,Angular,Typescript,我需要用这些值填写表格属性,但我不知道如何输入某些值在相应的列中 我的模型数据有: productInformations: {productId: 113698, name: "Asus PRIME H270-PRO Soc-1151"}, {productId: 113715, name: "MSI H110M PRO-VD Soc-1151"} comparisonProducts: sectionName: "Memory" comparison
productInformations:
{productId: 113698, name: "Asus PRIME H270-PRO Soc-1151"},
{productId: 113715, name: "MSI H110M PRO-VD Soc-1151"}
comparisonProducts:
sectionName: "Memory"
comparisonSpecifications:
specificationName: "Memory slots DDR4"
details:
{productId: 113698, value: "4"}
{productId: 113715, value: "2"}
specificationName: "Type of memory supported"
details:
{productId: 113698, value: "DIMM"}
{productId: 113715, value: "DIMM"}
//... order data//
我使用ngFor循环创建了一个表
<table class="table">
<thead>
<tr>
<th></th>
<th *ngFor="let product of comparisonResult.productInformations">{{product.name}}</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let comparison of comparisonResult.comparisonProducts">
<td><b>{{comparison.sectionName}}</b>
<ul *ngFor="let comparisonSpec of comparison.comparisonSpecifications">
<li>
{{comparisonSpec.specificationName}}
</li>
</ul>
</td>
<td *ngFor="let item of comparison.details">
{{item.value}} //as I understand it, here I need to bind the value to a specific productId
</td>
</tr>
</tbody>
</table>
{{product.name}
{{comparison.sectionName}}
{{comparisonspecificationname}
{{item.value}}//据我所知,这里我需要将该值绑定到特定的productId