title: How to select checkbox based on another checkbox state in AngularJs?
body: <p>Below is my scenario.</p>
  
  <blockquote>
    <p>I have 2 checkboxes named A &amp; B which are inside the ng-repeat element. The possible states of these 2 checkboxes are </p>
    
    <ol>
    <li>When A is truthy, B can be either truthy or falsey</li>
    <li>When A is falsey, B can never be truthy.</li>
    </ol>
  </blockquote>
  
  <p>Below is my code which I tried with ng-checked, but as ng-checked doesn't allow ng-model along with it, I couldn't come up with a solution.</p>
  
  <blockquote>
    <p>NOTE: I need to capture both these 2 checkboxes state in my Model</p>
  </blockquote>
  
  <pre><code>&lt;tbody&gt;
     &lt;tr ng-repeat="vehicle in editor.vehicles"&gt;                                        
        &lt;td&gt;
           &lt;v-check name="A" ng-model="vehicle.modelA"&gt;&lt;/v-check&gt;
        &lt;/td&gt;
        &lt;td&gt;
           &lt;v-check name="B" ng-model="vehicle.modelB" ng-checked="vehicle.modelA"&gt;&lt;/v-check&gt;
        &lt;/td&gt;
     &lt;/tr&gt;
  &lt;/tbody&gt;
  </code></pre>
  
  <p>Above code uses a directive <code>v-check</code> which is nothing but a checkbox.</p>
  
  <p>EDIT:
  The template of my <code>v-check</code> directive:
      <code>&lt;label class='checkbox-inline'&gt;&lt;input ng-model='ngModel' type='checkbox'&gt;{{text}}&lt;/label&gt;</code></p>
  
  <p>Thanks in advance.</p>