【发布时间】:2021-08-08 17:02:26
【问题描述】:
我正在使用 Angular 11.1.4 和 typscript 4.1.5。我在很多地方都收到此错误...
我想根据不同的产品类型对我的对象进行分组。这是我的代码:
newPlatDenrees = [];
...
this.newPlatDenrees = this.plat.denrees.reduce((r, a) => {
r[a.typeProduit] = r[a.typeProduit] || [];
r[a.typeProduit].push(a);
return r;
}, Object.create(null));
然后我做一个这样的显示。问题是这种方式是有效的,但不可能发出“ionic build --prod”命令。 我不断收到此错误...
<ion-item-group *ngFor="let denree of newPlatDenrees | keyvalue; let i = index">
<ion-item-divider (click)="denree.toggle=!denree.toggle">
<ion-label>{{denree.key}}</ion-label>
<ion-icon slot="end" [name]="!denree.toggle ? 'chevron-down-outline' : 'chevron-forward-outline'">
</ion-icon>
</ion-item-divider>
<div *ngIf="!denree.toggle">
<ion-row *ngFor="let value of denree.value; let i = index ">
<ion-col class="ion-text-center">{{value.produit}}</ion-col>
<ion-col class="ion-text-center"> {{value.unite}}</ion-col>
<ion-col class="ion-text-center"> {{value.quantite}}</ion-col>
</ion-row>
</div>
</ion-item-group>
请帮帮我!
【问题讨论】:
标签: angular typescript ionic-framework ionic5 angular11