我正在遍历产品列表,然后检查产品 ID 是否已经存在于 products(objects) 数组中,然后如果产品不在对象中,则打印数量,然后尝试打印 0。下面是代码我一直尝试到现在。
<ion-item class="added" *ngFor="let item of fetchProducts();let key=index;">
<ng-container *ngFor="let cartitem of cart" >
<span class="count" *ngIf="cartitem.p_id==item.p_id;">
{{cartitem.qty}}
</span>
</ng-container>
</ion-item>
item如果不在cartitem同一跨度中,如何打印 0 。
一只萌萌小番薯
慕森卡
白衣非少年
相关分类