Set default option in mat-select
Solution 1:
Working StackBlitz
No need to use ngModel
or Forms
In your html:
<mat-form-field>
<mat-select [(value)]="selected" placeholder="Mode">
<mat-option value="domain">Domain</mat-option>
<mat-option value="exact">Exact</mat-option>
</mat-select>
</mat-form-field>
and in your component just set your public property selected
to the default:
selected = 'domain';
Solution 2:
Try this
<mat-form-field>
<mat-select [(ngModel)]="modeselect" [placeholder]="modeselect">
<mat-option value="domain">Domain</mat-option>
<mat-option value="exact">Exact</mat-option>
</mat-select>
</mat-form-field>
Component:
export class SelectValueBindingExample {
public modeselect = 'Domain';
}
Live demo
Also, don't forget to import FormsModule
in your app.module