title: ng-click doesn't change value in HTML when in ng-repeat
body: <p>So I don't know if this is a problem with AngularJS, or my understanding. </p>
  
  <p>In my app, I have an <code>ng-repeat</code> and I need to keep track of the active <code>$index</code>, which can be changed when you click on another item. So I thought I would do something like:</p>
  
  <pre><code>&lt;body ng-init="active = -1"&gt;
      &lt;span ng-repeat="item in items" ng-bind="item" ng-click="active = $index"&gt;&lt;/span&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>But this does not work; I know if I change the <code>ng-click</code> to <code>ng-click="select($index)</code> and apply the change in my controller, this would work. But I'd like to know why the implementation above doesn't work.</p>
  
  <p>Interestingly, if you don't have an <code>ng-repeat</code>, this DOES work, i.e:</p>
  
  <pre><code>&lt;body ng-init="active = -1"&gt;
      &lt;span ng-click="active = 0"&gt;Item 1&lt;/span&gt;
      &lt;span ng-click="active = 1"&gt;Item 2&lt;/span&gt;
      ...
  &lt;/body&gt;
  </code></pre>
  
  <p>Here is a <a href="http://plnkr.co/edit/hsVJacgwuH8q6HOL855J" rel="nofollow">Plunker</a> of these two scenarios. Why?</p>