簡體   English   中英

使用 Angular 材料將 mat-select 轉換為 mat-autocomplete

[英]Convert mat-select to mat-autocomplete using Angular Material

我正在嘗試將自動完成添加到 mat-form 字段。 當我添加括號時,我得到一個錯誤。 這是代碼:

    <mat-form-field class="example-full-width">
    <mat-label>Dropdown</mat-label>
    <mat-select (selectionChange)="onDropdownChange($event)" [ngModelOptions]="{standalone:true}" [(ngModel)]="someValue">
     <mat-option *ngFor="let someValue of someValues" [value]="someValue.id">
     {{otherValue.otherValues}}
     </mat-option>
     </mat-select>
    </mat-form-field>

Angular材料已經有一個自動完成組件,你需要使用它來代替: https://material.angular.io/components/autocomplete/overview

堆棧閃電戰

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM