title: How can I change an ng-repeat variable after a response from a socket
body: <p>Hi guys I have this simple bit of Angular:</p>
  
  <pre><code>app.controller('FriendsController', ['$scope', 'Page', 'Title', '$http', function($scope, Page, Title, $http) {
  
    $http.get('/friends')
    .success(function(data) {
      $scope.friends = data.data;
    })
    socket.on('friendslist', function(resp) {
      // Socket was emitted that a user was updated, they are now either Offline or Online
      // So find the proper element and update them to the new value
      if (resp.verb === "updated") {
        for (var i = 0; i &lt; $scope.friends; i++) {
          if ($scope.friends[i].id === resp.id) {
            $scope.friends[i].online = resp.data.online;
          }
        }
  
        //var $friendEl = $('i').find('[data-id="1"]').first();
        //console.log($friendEl);
        //
      }
    });
  
  }]);
  </code></pre>
  
  <p>I'm getting the data to the client side just fine after the socket is emitted, but it doesn't seem to update the value if I <code>console.log(resp)</code> it returns the data needed, but when I <code>console.log($scope.friends[i])</code> after it updates it still says whatever it was initialized with like the for loop is not finding it and updating it, but I know that it is. Any information would be great thanks.</p>