We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

how can i bind multiple questions with multiple radio button for each question that i get it from array

how can i show  multiple questions as labels with multiple radio button for each question that i get it from array and bind it to form 
for example 
1. favroite color with options as red, blue
2.favorite food with options as idly, dosa which i get it from array

i have attached screenshot of the same. thanks in advance

Regards
Thowbik


Attachment: screenshotlocalhost42002019.03.15172304.png_b929238c.zip

1 Reply

DL Deepa Loganathan Syncfusion Team March 19, 2019 05:26 AM UTC

Hi Thowfik, 
 
 
Thank you for contacting Syncfusion support. 
 
 
We have checked your requirement “To bind multiple questions with multiple radio button for each question that i get it from array” and prepared sample. Please check the below code snippet. 
 
 
HTML 
<div class="control-section"> 
    <div *ngFor="let value of arrayValue"> 
        <h3>{{value.Qts}}</h3> 
        <ejs-radiobutton *ngFor="let key of value.options;" label={{key}} name={{value.name}}></ejs-radiobutton> 
    </div> 
</div> 
 
 
TS 
export class RadioButtonController { 
    public arrayValue = [{Qts: "Who is your fourite Actor:", name: "actor", options: ["Vijay", "Ajith"]},{Qts: "Which is your favorite Food:", name: "food", options: ["Fried Rice", "Curd Rice", "Sambar Rice"]}, {Qts: "Which is your favorite color:", name: "color", options: ["Red", "Blue", "Green", "Yellow"]}]; 
} 
 
 
 
 
Could you please check the above sample and get back to us if you need any further assistance on this? 
 
 
Regards, 
 
Deepa L. 


Loader.
Live Chat Icon For mobile
Up arrow icon