I have two radio buttons and I need to add some rules for disabling the radio buttons. So one button could be enabled and the other will be disabled. But I cannot figure out how to disable just one radio button in the mat-radio-group.
HTML code:
<mat-radio-group
ngDefaultControl
autocapitalize="off"
aria-autocomplete="off"
text-center
>
<mat-radio-button
id="BW_input_NOTICE90"
value="NOTICE90"
color="primary"
formControlName="notice90"
>
90 Days
</mat-radio-button>
<mat-radio-button
id="BW_input_NONOTICE"
value="NONOTICE"
color="primary"
formControlName="noNotice"
>
No Notice
</mat-radio-button>
</mat-radio-group>
In the .ts component I have tried this.form.controls.noNotice.disable();
and this.form.get('noNotice').disable();
but these aren't working.
How do you disable a radio button from the component?