I have this piece of HTML in my project of angular:
<th2-mat-radio-group
[radioButtonList]="isOneWayRadioButtons"
[form]="typeSettingForm"
formControlFieldName="isOneWay"
[required]="false"
name="isOneWay">
</th2-mat-radio-group>
but I keep getting this warning in the console even though I’m not using the disabled attribute here. If I delete the [form] part the warning disappears but the form stops working.
Th2MatRadioGroupComponent.ngfactory.js:212
It looks like you’re using the disabled attribute with a reactive form directive. If you set disabled to true
when you set up this control in your component class, the disabled attribute will actually be set in the DOM for
you. We recommend using this approach to avoid ‘changed after checked’ errors.
Example:
form = new FormGroup({
first: new FormControl({value: 'Nancy', disabled: true}, Validators.required),
last: new FormControl('Drew', Validators.required)
});
I have this in my settings-form.ts:
isOneWay: new FormControl({ value: false, disabled: true }, []),
How can I delete this warning and keep the buttons functional? Thank you so much.
I want to delete de warning from the console but keep having the form working correct.