Posts

Showing posts from March 16, 2019

Angular Material mat-select set default selected value

Image
0 I am using Angular 7 and Angular Material. I want my to have a default value, but it is not working as expected. <mat-select required [(value)]="userProfile.gender"> <mat-option value="Male">Male</mat-option> <mat-option value="Female">Female</mat-option> </mat-select> userProfile does have a property and the value is Male in my test case, but nothing is being selected in the html. What am I doing wrong? javascript angular angular-material share | improve this question asked Jan 2 at 17:14 dshukertjr dshukertjr ...