I have a radio group which uses the same form control for each option. Is it possible to disable just the red radio button? I know you can set the disabled flag on the color form control but this will disabled all radio buttons.
<fieldset [formGroup]="colorForm">
<legend>
Choose color
</legend>
<div class="radio">
<label>
<input type="radio" value="red" formControlName="color">
Red
</label>
</div>
<div class="radio">
<label>
<input type="radio" value="green" formControlName="color">
Green
</label>
</div>
<div class="radio">
<label>
<input type="radio" value="blue" formControlName="color">
Blue
</label>
</div>
try this out
<input type="radio" [attr.disabled]="propertyName === false || null""
value="red" formControlName="color">
propertyName i.e. value comes from components.ts file
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With