title: Getting selected radio buttons from different sets of radio buttons in Angular.js
body: <p>Just started in Angular.js and have ran into a little hiccup that is taking a lot longer than it should to figure out. I have 3 sets of 4 radio buttons. I'm trying to access which radio buttons the user has selected in each set. The problem is so far I can only do it with one set. If there's more than one set, after the user selects one radio button, all the sets switch to that selected radio button. I'm pretty sure it has to do with my ng-model="$parent.selected" but I'm not sure how to fix it.</p>
  
  <p>I couldn't get Angular working with JSFiddle for some reason so here's what I have:</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;form name="myForm" ng-controller="testController"&gt;
  
    &lt;div ng-repeat="question in questions | limitTo:3"&gt;
  
      &lt;div&gt;{{question.Question}}&lt;/div&gt;
  
      &lt;input type="radio" ng-model="$parent.selected" value="A" name="{{question.id}}" /&gt;{{question.A}}&lt;br /&gt;
      &lt;input type="radio" ng-model="$parent.selected" value="B" name="{{question.id}}" /&gt;{{question.B}}&lt;br /&gt;
      &lt;input type="radio" ng-model="$parent.selected" value="C" name="{{question.id}}" /&gt;{{question.C}}&lt;br /&gt;
      &lt;input type="radio" ng-model="$parent.selected" value="D" name="{{question.id}}" /&gt;{{question.D}}&lt;br /&gt;
  
      Selected = {{selected}}
  
    &lt;/div&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>angular.module('nodeServerApp')
  .controller('testController', function ($scope) {
  
   $scope.questions = 
   [
       {
           "id": 0,
           "Question": "Is C the right answer?",
           "A": "This is choice A.",
           "B": "This is choice B.",
           "C": "This is choice C.",
           "D": "This is choice D.",
           "Answer": "C"
       },
       {
           "id": 1,
           "Question": "Is A the right answer?",
           "A": "This is choice A.",
           "B": "This is choice B.",
           "C": "This is choice C.",
           "D": "This is choice D.",
           "Answer": "A"
       },
       {
           "id": 2,
           "Question": "Is D the right answer?",
           "A": "This is choice A.",
           "B": "This is choice B.",
           "C": "This is choice C.",
           "D": "This is choice D.",
           "Answer": "D"
       }
   ];
  
   });
  </code></pre>