get value onChange from mat-select angular
<mat-select (selectionChange)="doSomething($event)">
get value onChange from mat-select angular
<mat-select (selectionChange)="doSomething($event)">
angular select change
<select (change)="onChange($event.target.value)">
<option *ngFor="let i of devices">{{i}}</option>
</select>
onChange(deviceValue) {
console.log(deviceValue);
}
select onchange pass option value in angular 6
<select (change)="onChange($event.target.value)">
<option *ngFor="let i of devices">{{i}}</option>
</select>
onChange(deviceValue) {
console.log(deviceValue);
}
ngmodel change
<select [ngModel]="selectedItem" (ngModelChange)="onChange($event)">
onChange(newValue) {
console.log(newValue);
this.selectedItem = newValue; // don't forget to update the model here
// ... do other stuff here ...
}
onchange event angular select
-------------For Two Way Data Binding-----------------
<select [ngModel]="selectedDevice" (ngModelChange)="onChange($event)" name="deviceText">
<option [value]="i" *ngFor="let i of devices">{{i}}</option>
</select>
onChange(event){
selectedDevice=event;
-----
-----
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us