title: Angular ng-repeat - unique $index across multiple loops
body: <p>Im using ng-repeat to loops through an array of objects for which I would like to print numbered headings.</p>
  
  <p>For example:</p>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>var cars = [
      {make:'ford',model:'mustang'},
      {make:'ford',model:'fusion'},
      {make:'bwm',model:'x5'},
      {make:'honda',model:'civic'},
      {make:'honda',model:'accord'},
      {make:'toyota',model:'camry'},
      {make:'honda',model:'crv'},
  ];
  </code></pre>
  
  <p><strong>View</strong></p>
  
  <pre><code>&lt;div ng-repeat="car in cars" ng-show="car.make=='ford'"&gt;
      &lt;h1&gt;Fords:&lt;/h1&gt;
      &lt;div&gt;&lt;b&gt;{{$index}})&lt;/b&gt; {{car.model}}&lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div ng-repeat="car in cars" ng-show="car.make=='honda'"&gt;
      &lt;h1&gt;Hondas:&lt;/h1&gt;
      &lt;div&gt;&lt;b&gt;{{$index}})&lt;/b&gt; {{car.model}}&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>Expected Output</strong></p>
  
  <pre><code>Fords:
  0) mustang
  1) fusion
  
  Hondas:
  0) civic
  1) accord
  2) crv 
  </code></pre>
  
  <p><strong>Actual Output</strong></p>
  
  <pre><code>Fords:
  0) mustang
  1) fusion
  
  Hondas:
  3) civic
  4) accord
  6) crv 
  </code></pre>
  
  <p>In other words, within each loop $index maintains a reference to that of the source array. Which I guess makes sense but I thought the purpose of $index was to count iterations within the scope of a given loop?</p>
  
  <p>How can I use $index (or something else) to achieve my <strong>Expected Output</strong>?</p>