title: How to check radio button Angular JS?
body: <p>How to check radio button?
  I need that if <code>$type == '1'</code> check input and set value = <code>1</code></p>
  
  <p>I tried:</p>
  
  <p><strong>First Input:</strong></p>
  
  <pre><code>&lt;input type="radio" 
         name="sex[]" 
         ng-init="formData.sex = '&lt;?=($type == '1' ? '1' : null)?&gt;" 
         ng-model="formData.sex"' 
         required&gt;
  </code></pre>
  
  <p><strong>Second input:</strong></p>
  
  <pre><code>   &lt;input type="radio" 
             name="sex[]" 
             ng-init="formData.sex = '&lt;?=($type == '2' ? '2' : null)?&gt;" 
             ng-model="formData.sex"' 
             required&gt;
  </code></pre>
  
  <p>When I submit form I see that <code>formData.sex = true</code>, so Angular JS gets value from second input howether is selected first, because condition <code>$type == '1'</code> is true.</p>