title: Why angularJs updates all elements of an array/hashmap, if only one changed?
body: <p>I have a simple hashmap and a simple method which displays the status in text, but when I update only 1 user-status, all of them are getting updated (function is called for all users). Is there a way to update only one element and not all of them? </p>
  
  <p>Example code is here, just see what happens in console when you click on the "Change Status" button.</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div ng-app="myApp"&gt;
    &lt;div ng-controller="Ctrl"&gt;
      &lt;div class="user-panel" ng-repeat = "(id, user) in _users"&gt;
          Status: 
          &lt;span class="user-status{{user.status}}"&gt;
              {{getStatusInText(user.status)}}
          &lt;/span&gt;
          &lt;hr&gt;
          &lt;div class="toLeft"&gt;(&lt;b&gt;{{id}}&lt;/b&gt;) {{user.name}}&lt;/div&gt;
          &lt;div class="toRight"&gt;
              &lt;button ng-click="changeUserStatus(id, '1')"&gt;Change Status&lt;/button&gt;
          &lt;/div&gt;
         &lt;div class="clear"&gt;&lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;    
  &lt;/div&gt;
  </code></pre>
  
  <p>AngularJS:</p>
  
  <pre><code>var app = angular.module('myApp', []);
  
  function Ctrl($scope) {
      $scope._users = {"123":{"name":"test","status":"0"}, "124":{"name":"test2", "status":"0"},"125":{"name":"test2", "status":"0"}};
  
      $scope.getStatusInText = function(status) {
          console.log("CALLED: " + status);
          return (status === "1") ? "online" : "offline";
      }
  
      $scope.changeUserStatus = function(uId, status) {
          $scope._users[uId].status = status;
  
      }
  }
  </code></pre>
  
  <hr>
  
  <p>And the fiddle for above example:</p>
  
  <p><a href="http://jsfiddle.net/ztVnj/3/" rel="nofollow">http://jsfiddle.net/ztVnj/3</a></p>
  
  <p>another example with iteration, which is called everytime with the getStatusInText function.</p>
  
  <p><a href="http://jsfiddle.net/ztVnj/4/" rel="nofollow">http://jsfiddle.net/ztVnj/4/</a></p>