我在<mat-option>
中的部分文字需要删除。问题在于所选值丢失了其Html标签。
这是下拉列表:
这是选定的值:
这是HTML代码:
<div fxLayout="row" fxLayoutAlign="start baseline">
<span fxFlex="0 0 110px" class="text-sm text-muted-dk">Currency Position</span>
<div fxLayout="column" fxFlex>
<mat-form-field fxFlex>
<mat-select #navigationArrowMode [formControl]="form.controls['currencyPosition']">
<mat-option
*ngFor="let currencyPosition of currencyPositions"
[value]="currencyPosition"
>
{{ CurrencyPositionToLabelMapping[currencyPosition] }}</mat-option
>
</mat-select>
</mat-form-field>
</div>
</div>
打字稿代码:
this.PriceOrderToLabelMapping = {
[PriceOrders.OriginalFirst]: `<del>$110</del> $99 Sale`,[PriceOrders.SalePriceFirst]: `$99 Sale <del>$110</del>`
};