Below is the structure of my form:
form = new FormGroup({
name: new FormControl('', Validators.required),
comment: new FormControl(''),
endpointsPermissions: new FormControl({
read: new FormControl(null),
write: new FormControl(null)
}),
exportDefinitionsPermissions: new FormControl({
read: new FormControl(null),
write: new FormControl(null)
}),
sourcesPermissions: new FormControl({
read: new FormControl(null),
write: new FormControl(null)
})
});
When trying to implement it in my HTML file, I used the following code snippet:
<mat-form-field appearance="fill" fxFlex="100">
<mat-checkbox [formControl]="form.get('endpointsPermissions').value.read">{{"ROLES.READ" | translate}}</mat-checkbox>
</mat-form-field>
However, I encountered some errors:
control.registerOnChange is not a function
mat-form-field must contain a MatFormFieldControl.
Can someone guide me on how to correctly use [formControl] with nested FormControls?