title: angularjs ng-repeat increment in if-condition
body: <p>I Want to set a Variable outside ng-repeat and increment it inside of ng-if.
  Only when the condition is false, the variable should incremented.</p>
  
  <p>In Twig it looks like:</p>
  
  <pre><code>{% for plan in entity.plan %}  
     {% set spieltag = 0 %} &lt;!-- sets the variable inside loop --&gt;
  
     {% if (plan.spieltag != spieltag)  %}
     &lt;tr class="bg-info"&gt;
        &lt;td colspan="7"&gt;Spieltag: {{ plan.spieltag }}&lt;/td&gt;
        &lt;td&gt;&lt;/td&gt;
     &lt;/tr&gt;
  
  {% set spieltag = spieltag +1 %} &lt;!-- only increments when condition is false --&gt;
  {% endif %}
  &lt;tr&gt;
      &lt;!-- some stuff that always shown  
  &lt;/tr&gt;
  {% endfor %}
  </code></pre>
  
  <p>In Angular i have a tr-loop:</p>
  
  <pre><code>&lt;tr data-ng-repeat="row in liga.plan" data-ng-init="spieltag = 0"&gt;
     &lt;!-- shows all the stuff --&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>I know the ng-init is on the wrong place, but where should i take it and how can i increment it only when the condition is false?</p>
  
  <p>Data from the loop:</p>
  
  <pre><code>[{
      plan: [
          {spieltag: 1, home: foo, guest: bar},
          {spieltag: 1, home: foo1, guest: bar1},
          {spieltag: 1, home: foo2, guest: bar2},
          {spieltag: 2, home: bar, guest: foo},
          {spieltag: 2, home: bar1, guest: foo1},
          {spieltag: 2, home: bar2, guest: foo2},
      ]
  
  }]
  </code></pre>