<mat-form-field>
<mat-label>Tipo documento</mat-label>
<mat-select id="select2" (selectionChange)="loadPath($event.value)" [(ngModel)]="this.valueTipDoc">
<mat-option *ngFor="let opt of optPath" [value]="opt.id">
{{opt.name}}
</mat-option>
</mat-select>
</mat-form-field>
我已经使用了ngModel,但是它没有选择任何东西,会有办法吗?
this.valueTipDoc=this.data1.idPath[0].doctype.toString();
您需要ngModel和mat中的名称-使用相同的变量进行选择。例如: