title: Increment A Variable In AngularJS Template
body: <p>I'll preface this by saying I am very new to AngularJS so forgive me if my mindset is far off base. I am writing a very simple single page reporting app using AngularJS, the meat and potatoes is of course using the angular templating system to generate the reports themselves. I have many many reports that I am converting over from a Jinja-like syntax and I'm having a hard time replicating any kind of counter or running tabulation functionality.</p>
  
  <p>Ex.</p>
  
  <pre><code>{% set count = 1 %}
  {% for i in p %}
    {{ count }}
    {% set count = count + 1 %}
  {% endfor %}
  </code></pre>
  
  <p>In my controller I have defined a variable like <code>$scope.total = 0;</code> which I am then able to access inside of the template without issue. What I can't quite figure out is how to increment this <code>total</code> from within an <code>ng-repeat</code> element. I would imagine this would look something like -</p>
  
  <pre><code>&lt;ul&gt;
      &lt;li ng-repeat="foo in bar"&gt;
          {{ foo.baz }} - {{ total = total + foo.baz }}
      &lt;/li&gt;
  &lt;/ul&gt;
  &lt;div&gt; {{ total }} &lt;/div&gt;
  </code></pre>
  
  <p>This obviously doesn't work, nor does something like <code>{{ total + foo.baz}}</code>, thanks in advance for any advice.</p>