I have a mat-select where the options are all objects defined in an array. I am trying to set the value to default to one of the options, however it is being left selected
I did it just like in these examples. Tried to set the value of the mat-select to the value of one of the mat-options. But failed.
My mistake was to do [(value)]="someNumberVariable" to a numeric type variable while the ones in mat-options were strings. Even if they looked the same in the template it would not select that option.
Once I parsed the someNumberVariable to a string everything was totally fine.
So it seems you need to have the mat-select and the mat-option values not only be the same number (if you are presenting numbers) but also let them be of type string.