Angular6 要在单击“编辑”按钮时获取productCode的值吗
我想在单击编辑按钮时获取productCode的值Angular6 要在单击“编辑”按钮时获取productCode的值吗,angular6,Angular6,我想在单击编辑按钮时获取productCode的值 <tr *ngFor=" let x of response"> <td ><img src = "{{x.productPrimaryImage}}"></td> <td>{{x.productCode}}</td> <td>{{x.productName}}</td>
<tr *ngFor=" let x of response">
<td ><img src = "{{x.productPrimaryImage}}"></td>
<td>{{x.productCode}}</td>
<td>{{x.productName}}</td>
<td>{{x.status}}</td>
<td>{{x.productCategories}}</td>
<td>{{x.productMRP}}</td>
<td>{{x.productSSP}}</td>
<td>{{x.productYMP}}</td>
<td><button class=" btn btn-info btn-sm" (click)"editProduct()">edit</button></td>
</tr>
</tbody>
</table>
假设
editProduct
方法采用productCode
参数,您可以这样传入它:
<button class=" btn btn-info btn-sm" (click)"editProduct(x.productCode)">edit</button>
编辑
<button class=" btn btn-info btn-sm" (click)"editProduct(x.productCode)">edit</button>