Change a value inside ng-repeat cycle with ng-click
<p>I want to change a value of an item inside an ng-repeat cycle using a function.</p>

<p>This for example won't work.</p>

<p>HTML</p>

<pre><code>&lt;ul class="unstyled"&gt;
  &lt;li ng-repeat="todo in todoList.todos"&gt;
      &lt;span&gt;{{todo.name}}&lt;/span&gt;
      &lt;button ng-click="example(todo)"&gt;Change me&lt;/button&gt;
  &lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>JS</p>

<pre><code>$scope.example = function(v) {
  v.name = 'i am different now';
};
</code></pre>

<p>Full example</p>

<p><a href="http://plnkr.co/edit/kobMJCsj4bvk02sveGdG" rel="nofollow">http://plnkr.co/edit/kobMJCsj4bvk02sveGdG</a></p>