How to get selected radio by name without using ViewChile

How can I get the value of the selected radio button without using ViewChild?

There is no documentation in syncfusion about this.

Here's my HTML code


<ul>
                            <li>
                                <ejs-radiobutton #rbClinician label="Clinician Block" name="block" checked="true">
                                </ejs-radiobutton>
                            </li>
                            <li>
                                <ejs-radiobutton #rbPatient label="Future Patient" name="block"></ejs-radiobutton>
                            </li>
                            <li>
                                <ejs-radiobutton #rbInfo label="Patient Information" name="block"></ejs-radiobutton>
                            </li>
                        </ul>

1 Reply

AS Aravinthan Seetharaman Syncfusion Team October 10, 2021 03:55 AM UTC

Hi BOB, 
 
Thanks for contacting Syncfusion Support. 
 
We have checked your query. We can able to achieve your requirement by using ngModel in RadioButton. Please refer the below code snippet and sample. 
 
app.component.ts 
 
export class AppComponent { 
  public value: string = 'no'; 
} 
 
 
app.component.html 
 
<div class="control-section"> 
  <div class="radiobutton-control"> 
    <h4>Choose Option</h4> 
    <div class="row"> 
      <ejs-radiobutton 
        label="Yes" 
        value="yes" 
        name="autoRenew" 
        [(ngModel)]="value" 
      ></ejs-radiobutton> 
    </div> 
    <div class="row"> 
      <ejs-radiobutton 
        label="No" 
        value="no" 
        name="autoRenew" 
        [(ngModel)]="value" 
      ></ejs-radiobutton> 
    </div> 
  </div> 
</div> 
<h4>Selected Value</h4> 
<span>{{ value }}</span> 
 
 
 
For more details, please refer the below UG link

 
 
Could you please check the above details and get back to us, if you need assistance on this. 
 
Regards, 
Aravinthan S 


Loader.
Up arrow icon