我有这个code,我想知道如何在标签上显示所选的值。谢谢!
答案 0 :(得分:1)
这应该可以解决问题:stackblitz
<mat-form-field>
<mat-select #select [placeholder]="selectedLanguage?.value?.value || 'Language'" (selectionChange)="selectedLanguage = $event"
panelClass="panelResponsive">
<mat-option *ngFor="let language of filteredLanguages" [value]="language">
<span>{{language.value}}
</span>
</mat-option>
</mat-select>
</mat-form-field>