<mat-form-field>
<mat-select name="role" [(ngModel)]="user.role">
<mat-option *ngFor="let role of roles" [value]="role">
{{ role.name }}
</mat-option>
</mat-select>
</mat-form-field>
the mat has to set the user's role as the default selected value
Initially, the mat-select is empty unless I select one of the options (the selection changes are reflected to the user.role so this is a correct behaviour)
angular 4.4.6
material 2.0.0-beta.12
I know it seems that this issue had been answered in #7771. But that case is with simple value types (number or string) . My issue appears when the value is an object
See the paragraph here about compareWith.
EDIT: Should be on the material.angular.io docs after the next release.
Also take a look at @rafaelss95's example here: https://github.com/angular/material2/issues/6970#issuecomment-328355857
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
See the paragraph here about
compareWith.EDIT: Should be on the material.angular.io docs after the next release.