i am kind of stuck here, i am new to angular js.
I have a form having number of questions. These questions are loading with angularjs.
html for form is
<form ng-controller="controller" ng-submit="submitFirstQuiz()">
<div ng-repeat = "question in quiz.questions">
{{question}}
<label data-ng-repeat="choice in quiz.choices" style="float:left;">
<input name="{{question}}" type="radio" value="{{choice}}"/>
</label>
<br/>
</div>
<input type="submit" value="submit"></input>
</ng-form>
and my js is
'use strict';
var QuizModule = angular.module('quiz');
QuizModule.controller('PersonalityQuizCtrl', function($scope){
$scope.quiz = {
questions: ["q1","q2","q3"],
choices: ["5","4","3","2","1"]
};
$scope.submitFirstQuiz = function(){
console.debug("how to print selected choices");
};
});
The above code is generating my form as i want. Now how can i get the selected values of the radio buttons, in other word how can i submit the form with selected value. I don't how to bind the result data. Kindly help me, i shall be thankful. Regards,