如何在mat-select angular中获取所选选项值的id 5.仅获取onchangeevent中所选选项的值.但是如何获得所选选项值的id.
client.component.html
<mat-form-field>
<mat-select placeholder="Client*" #clientValue (change)="changeClient($event)">
<mat-option *ngFor="let client of clientDetails" [value]="client.clientName">
{{client.clientName | json}}
</mat-option>
</mat-select>
</mat-form-field>
client.component.ts file
export class Client{
changeClient(event){
console.log(event);
}
}
Run Code Online (Sandbox Code Playgroud)