title: Angularjs - How to keep count of total iterations across nested ng-repeat in the template
body: <p>I have a fairly large object that needs to be iterated over in nested ng-repeat loops</p>
  
  <p>A simplified version looks like this:</p>
  
  <pre><code>{{totalEvents = 0}}
  &lt;div ng-repeat="(mainIndex, eventgroup) in EventsListings"&gt;
  
  &lt;ul&gt;
      &lt;li ng-repeat="event in eventgroup.events" ng-click="Current(totalEvents)"&gt;
  
      &lt;div class="event-item-container" ng-show="eventDetailsView[totalEvents]"&gt;
          {{totalEvents = totalEvents + 1}}
      &lt;/div&gt;
  
     &lt;/li&gt;
  
  &lt;/ul&gt;
  
  &lt;/div&gt;
  {{totalEvents = 0}
  </code></pre>
  
  <p>How can I keep track of totalEvents counter value.. How can I get a total number of iterations across nested loops IN the template?</p>