0

我已经使用 selectionChange 事件创建了一个 mat-select,但是当值更改时,该事件不会被触发。

.html 文件

<mat-select (selectionChange)="changeCategory()">
                    <mat-option *ngFor="let category of categoryList" [value]="category._id">{{category.name}} </mat-option> </mat-select>

ts文件

changeCategory(){
    console.log('ok')
  }
4

1 回答 1

1

在您的app.module.ts中导入MatSelectModule

于 2022-01-21T07:50:45.773 回答