title: Is there some way I can get a $index when I have an ng-repeat inside an ng-repeat?
body: <p>My application used to have this code:</p>
  
  <pre><code>&lt;div ng-click="getQuestion(q.number)
       ng-repeat="q in qs"&gt;{{ q.number }}&lt;/div&gt;
  </code></pre>
  
  <p>It very simply displayed <code>&lt;div&gt;</code>s with each containing a question number and it had a click event. There were also 5-6 other uses of the <code>q</code> within each repeat but to simplify I'm just showing this above.</p>
  
  <p>Now I was asked to change this into a CSS:table that consists of 5 rows with each row having ten columns. To do this I used two ng-repeats with one inside the other like this:</p>
  
  <pre><code>&lt;div ng-repeat="i in [0,1,2,3,4]"&gt;
     &lt;div ng-repeat="j in [0,1,2,3,4,5,6,7,8,9]"&gt;
        &lt;div ng-click="getQuestion(qs[i * 10 + j + 1].number)"&gt;
          {{ qs[i * 10 + j + 1].number }}  
        &lt;/div&gt;
     &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The formula :  <code>qs[i * 10 + j + 1]</code> gives me the same as I was getting before with <code>q</code>.  </p>
  
  <p>However within that middle  I need to access qs[i * 10 + j + 1] many times
  and so this formula appears in many different places. </p>
  
  <p>Is there some way using ng-repeat or something else that I could simplify 
  this. I read about $index but in this case I need something like an $index that gives me the position from the outer loop. </p>