angular 8 下拉更改事件不起作用
angular 8 dropdown change event is not working
我正在使用 Angular 8 和 Material 设计。
我正在尝试在我的下拉列表中检测更改事件。
我做错了什么?
angular 是否更改了一些事件名称?
这是HTML代码:
<mat-select (change)="onChangedSort($event)" [(value)]="selected">
<mat-option value="all">All</mat-option>
<mat-option value="some_values">some other options</mat-option>
</mat-select>
这是Angular TS文件代码:
onChangedSort(event:Event){
console.log(event);//nothing is happening here
//some code
}
我也试过 selectChange
。
是(selectionChange)
,不是(changed)
我正在使用 Angular 8 和 Material 设计。
我正在尝试在我的下拉列表中检测更改事件。
我做错了什么?
angular 是否更改了一些事件名称?
这是HTML代码:
<mat-select (change)="onChangedSort($event)" [(value)]="selected">
<mat-option value="all">All</mat-option>
<mat-option value="some_values">some other options</mat-option>
</mat-select>
这是Angular TS文件代码:
onChangedSort(event:Event){
console.log(event);//nothing is happening here
//some code
}
我也试过 selectChange
。
是(selectionChange)
,不是(changed)