title: Access index of the parent ng-repeat from child ng-repeat
body: <p>I want to use the index of the parent list (foos) as an argument to a function call in the child list (foos.bars).</p>
  
  <p>I found a post where someone recommends using $parent.$index, but <code>$index</code> is not a property of <code>$parent</code>.</p>
  
  <p>How can I access the index of the parent <code>ng-repeat</code>?</p>
  
  <pre><code>&lt;div ng-repeat="f in foos"&gt;
    &lt;div&gt;
      &lt;div ng-repeat="b in foos.bars"&gt;
        &lt;a ng-click="addSomething($parent.$index)"&gt;Add Something&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>