title: $index of ng-repeat not incremented inside ng-if
body: <p><code>$index</code> value not increment inside <code>ng-if</code> block.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div ng-repeat="household in census.households track by $index"&gt;
      &lt;div ng-if="household.ask_for_tobacco"&gt;
         &lt;input id="tobacco_{{$index}}" type="checkbox" ng-model="member.smoker"&gt;
         &lt;label for="tobacco_{{$index}}"&gt;&lt;/label&gt;
       &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>In above block, I am using ng-repeat and <code>ng-if</code> inside it. I am following condition <code>ng-if</code> and setting element id with <code>$index</code>. Element ID is being set <code>0</code> every time, rather than incremented to <code>1,2,3...</code></p>
  
  <p>If <code>ng-if</code> removed, it works without fail. So anyone has used and faced same issue. Please give me solution. </p>