title: Angularjs - in nested ng-repeaters, how do you get index of outher repeater item within nested repeater
body: <p>If I have nested ng-repeaters,, like this</p>
  
  <pre><code>&lt;div ng-repeat="outeritem in outerobject"&gt;
  
      &lt;div ng-repeat="inneritem in innerobject" ng-click="function(inneritem.key, $index)"&gt;&lt;/div&gt;
  
  &lt;div&gt;
  </code></pre>
  
  <p>How would I get the <code>$index</code> from <strong>outterobject</strong> repeater in <code>function(inneritem.key, $index)</code> which is in <code>ng-click</code> directive of <strong>innerobject</strong> repeater?</p>
  
  <h2>Update:</h2>
  
  <p>I ended up using this approach although there are two other good ones mentioned in below posts.</p>
  
  <pre><code>&lt;div ng-repeat="(indexvalue, outeritem) in outerobject"&gt;
  
      &lt;div ng-repeat="inneritem in innerobject" ng-click="function(inneritem.key, indexvalue)"&gt;&lt;/div&gt;
  
  &lt;div&gt;
  </code></pre>