I have an object contentType
export interface ContentType {
code: string;
label: string;
}
I want to select this object as value of my mat-select, is a formgroup inside the form, the binding not works. If y put formControl=contentType i have an error because this is nos a formControl is a formGroup.
this.formGroup = this.formGroup.group({
contentType: this.formGroup.group(),
});
<div form="formGroup">
<mat-form-field>
<mat-select [formGroupName]="'contentType'">
<mat-option [(value)]="contentType" *ngFor="let contentType of contentTypes$ | async">
{{contentType.label}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
What can i do to binding well the contentType, thanks.