title: Angularjs multiple radio button, auto-select if only one is present
body: <p>Am successful in building angularjs app of multiple dependent radio button.</p>
  
  <p>But have a requirement to default select a radio button if only one is present.</p>
  
  <p>Tried out the stuff in <a href="https://stackoverflow.com/questions/18518251/angularjs-radio-button-checked">Angularjs: radio button checked</a>, but it doesn't work for multiple radio buttons.</p>
  
  <p>Code Explanation:</p>
  
  <p>HTML Code:
  I have two radio buttons. Second set of radio buttons are generated based on the first.</p>
  
  <pre><code>&lt;div&gt;
              &lt;ul &gt;
                &lt;li&gt; Part One : &lt;/li&gt;
                          &lt;li ng-repeat="f in Input"&gt;&lt;input type="radio" name="oneInput" ng-value="f" ng-model="$parent.One"&gt;&amp;nbsp;{{f.Name}}&amp;nbsp;&lt;/input&gt;&lt;/li&gt;
      &lt;/ul&gt;
      &lt;/div&gt;&lt;br/&gt;
      &lt;div&gt;
                &lt;ul&gt;
                    &lt;li&gt; Part Two : &lt;/li&gt;
                    &lt;li ng-repeat="u in filteredUser = (One.User | filter: { Valid: 'Y' })"&gt;&lt;input type="radio" name="userInput" ng-value="u" ng-model="$parent.Two"&gt;&amp;nbsp;{{u.Name}}&amp;nbsp;&lt;/input&gt;&lt;/li&gt;
              &lt;/ul&gt;
      &lt;/div&gt;&lt;br/&gt;
  </code></pre>
  
  <p>If I select a radio button in first set, and second set has only one radio button, it must be selected by default.</p>
  
  <p>For example, if I select D, I get the D2 radio button which must be selected.</p>
  
  <p>Complete Code @ <a href="http://plnkr.co/edit/dY2syxNWobxHpiVKIuux?p=preview" rel="nofollow noreferrer">http://plnkr.co/edit/dY2syxNWobxHpiVKIuux?p=preview</a></p>
  
  <p>Appreciate your response.</p>