相关疑难解决方法(0)

来自 *ngFor 循环的角度总和动态数据以获取总计、小计和增值税值 (%16)

所以我遇到了问题。我需要根据 *ngFor 循环中的动态数据动态计算 tag.price 的总和,还有 sub-total 和 vat。下面是我的 html 和我的 ts 代码。小计、总计和增值税值将在此块下方的循环之外。任何帮助将不胜感激。

 <tr *ngFor="let tag of locations">

 <td align="center"><span style="font-size: 17px;" class="menu-icon 
 icon-file-text2"></span></td>

 <td>{{tag.title}}</td>

 <th>{{tag.listingType}}</th>

 <th>{{ tag.size }}</th>

 <td>KSH {{tag.price | amount:locale}}</td>

 <td>KSH {{tag.price | amount:locale}}</td>

 </tr>


 // component ts
 setTags(id:any, title:any, price:any, listingType:any, size:any){
this.locations.push({
  title: title,
  id: id,
  price: price,
  listingType: listingType,
  size: size
});
Run Code Online (Sandbox Code Playgroud)

}

angular

1
推荐指数
1
解决办法
3069
查看次数

标签 统计

angular ×1