I am trying to iterate over array of questions. But I need to attach radio button answers to each question.
In this case I need to add different ng-models for each answer.
I tried the code below but it didn't work.
Is this the correct way of using $index of the ng-repeat?
<li class="fields" ng-repeat="question in questions">
<p>question:{{question.title}}</p>
<div class="radio-buttons">
<input type="radio" id="radio01" value="0" ng-model="answer[$index]" checked="checked"/>
<label for="radio01"><span></span>Yes</label>
<input type="radio" id="radio02" value="1" ng-model="answer[$index]"/>
<label for="radio02"><span></span>No</label>
</div>
</li>
answerarray. Or maybe you wantng-model="question.answer"?