MatRadioGroupComp wanr in console

Discussão em 'Angular' iniciado por Jennifer Yasmin, Outubro 28, 2024.

  1. 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 warn in the console even though Im not using the disabled attribute here. If I delete the [form] part the warn disspaears 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 warn and keep the buttons functional? Thank you so much.

    I want to delete de warn from the console but keep having the form working correctly.

    Continue reading...

Compartilhe esta Página