I am struggling to input a composed value into a select. Let’s say our object only contain an ID and a name, an usual way to have a working select would be to do :
<mat-form-field>
<mat-label>Placeholder</mat-label>
<mat-select>
<mat-option *ngFor="let i of fooCollection" (value)="i.id">
{{i.name}}
</mat-option>
</mat-select>
</mat-form-field>
Now to feed a value, I found this working example in the documentation which simply add a ((value))
option into the mat-select
tag, but since we got a composed object here it doesn’t work anymre.
Any idea on how to solve this ? Many thanks !
Kev’