我正在尝试将预先输入功能添加到我的 Angular 项目的下拉列表中。为此尝试使用 mat-autocomplete: html 代码如下:
<mat-form-field class="example-full-width">
<mat-select [(ngModel)]="sourceChosen" name="Source" (selectionChange)="sourceChange()">
<mat-autocomplete #auto="matAutocomplete">
<mat-option *ngFor="let l of sourceList" [value]="l">{{ l }}</mat-option>
</mat-autocomplete>
</mat-select>
</mat-form-field>
这没有用。知道怎么回事吗?另外,如果有人能建议一种更好的方法将提前输入功能添加到下拉列表中,我将不胜感激。TIA