在物料选择中显示所选值

时间:2018-08-23 11:52:42

标签: angular material

我有这个code,我想知道如何在标签上显示所选的值。谢谢!

1 个答案:

答案 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>