MATERIAL CHIPS 将逗号更改为 space
MATERIAL CHIPS Change comma to space
我使用materialangular芯片输入。
我这样显示数据:
<div [ngStyle]="{'font-size':'18px'}" *ngFor="let ppsToDisplay of ppssToDisplay | async">
<mat-list *ngIf="ppsToDisplay.effetsind" >Effets indésirables : <mat-chip-list>
<mat-chip> {{ ppsToDisplay?.effetsind }}</mat-chip>
</mat-chip-list>
</mat-list>
</div>
但我只有一个大筹码,因为筹码之间没有 space,只有逗号,
我该如何改变它?谢谢
你说的是 ppsToDisplay.effetsind
是一个逗号分隔的字符串?
如果我理解正确,这可能会解决问题:
<div [ngStyle]="{'font-size':'18px'}" *ngFor="let ppsToDisplay of ppssToDisplay | async">
<mat-list *ngIf="ppsToDisplay.effetsind" >Effets indésirables :
<mat-chip-list>
<mat-chip *ngFor="let effetsind of ppsToDisplay.effetsind.split(',')"> {{ effetsind }}
</mat-chip>
</mat-chip-list>
</mat-list>
</div>
我使用materialangular芯片输入。
我这样显示数据:
<div [ngStyle]="{'font-size':'18px'}" *ngFor="let ppsToDisplay of ppssToDisplay | async">
<mat-list *ngIf="ppsToDisplay.effetsind" >Effets indésirables : <mat-chip-list>
<mat-chip> {{ ppsToDisplay?.effetsind }}</mat-chip>
</mat-chip-list>
</mat-list>
</div>
但我只有一个大筹码,因为筹码之间没有 space,只有逗号,
我该如何改变它?谢谢
你说的是 ppsToDisplay.effetsind
是一个逗号分隔的字符串?
如果我理解正确,这可能会解决问题:
<div [ngStyle]="{'font-size':'18px'}" *ngFor="let ppsToDisplay of ppssToDisplay | async">
<mat-list *ngIf="ppsToDisplay.effetsind" >Effets indésirables :
<mat-chip-list>
<mat-chip *ngFor="let effetsind of ppsToDisplay.effetsind.split(',')"> {{ effetsind }}
</mat-chip>
</mat-chip-list>
</mat-list>
</div>