title: Select All checkbox to select nested angular ng-repeat checkboxes?
body: <p>I have a series of nested ng-repeat checkboxes, where it's a structure like:</p>
  
  <ul>
  <li>Checkbox
  <ul>
  <li>country</li>
  <li>country</li>
  <li>select all</li>
  </ul></li>
  <li>Checkbox
  <ul>
  <li>country</li>
  <li>country</li>
  <li>select all</li>
  </ul></li>
  </ul>
  
  <p>The "select all" in each group should select all "country" checkboxes in that group.</p>
  
  <p>You can see it in action here: <a href="http://plnkr.co/edit/rBIv9lfOr5MASPia7ORS?p=preview" rel="nofollow">http://plnkr.co/edit/rBIv9lfOr5MASPia7ORS?p=preview</a></p>
  
  <p>The inner checkboxes are generated by an array in the main json:</p>
  
  <pre><code>  $scope.carriers = 
    [{
      "name": "UPS",
      "selected": false,
      "hasPaymentOptions": false,
      "isSelectable": true,
      "value": "",
      "countries": [
          "USA","UK","Canada","Germany","Australia"
       ]
     },etc
  </code></pre>
  
  <p>And are in a nested ng-repeat:</p>
  
  <pre><code>&lt;!-- main list of carrier checkboxes --&gt;
      &lt;div ng-repeat="c in partnerent.carriers.carriers" class="spacer-top-md spacer-bottom-md"&gt;
        &lt;div class="carrier spacer-bottom-sm"&gt;
          &lt;div class="checkbox-inline"&gt;
            &lt;label&gt;
              &lt;input type="checkbox" name="{{c.name | slug}}" ng-model="c.selected"&gt; {{c.name}}
            &lt;/label&gt;
          &lt;/div&gt;
          &lt;!-- inner checkboxes for countries --&gt;
          &lt;ul class="entitlement-countries list-inline"&gt;
            &lt;li ng-repeat="ec in c.countries"&gt;
              &lt;div class="checkbox-inline"&gt;
                &lt;label&gt;
                  &lt;input type="checkbox" name="{{ec | slug}}"&gt; {{ec}}
                &lt;/label&gt;
              &lt;/div&gt;
              &lt;/li&gt;
              &lt;li ng-if="c.countries.length &gt; 0"&gt;
                &lt;div class="checkbox-inline"&gt;
                  &lt;label&gt;
                    &lt;input type="checkbox" name="{{ec | slug}}_selectall"&gt; Select all
                  &lt;/label&gt;
                &lt;/div&gt;
              &lt;/li&gt;
          &lt;/ul&gt;
  </code></pre>
  
  <p>It all works, but my question is how to have those "select all" checkboxes select their group of countries?  Most of the solutions and directives I've found involve the model and are generally for one group of checkboxes, where I have several inside a ng-repeat.</p>