title: How to update object in array
body: <p>I'm building a dashboard using AngularJS + SocketIO and Controller As vm syntax.</p>
  
  <p>I want to update my view when a specific IO message got receive:</p>
  
  <pre><code>var vm = this;
  vm.products = ProductService.query(); //Get an array of Products
  
  //When receiving an update through SocketIO, update the view
  SocketService.on('product:update', function(updated_product) {
      var found = $filter('filter')(vm.products, {_id: updated_product._id}, true);
      if(found.length) { //Product was found, updating product
          $filter('filter')(vm.products, {_id: updated_product._id}, true)[0] = updated_product;
      } else vm.products.push(updated_product); //else add a new product
  });
  </code></pre>
  
  <p>I tried adding a <code>$scope.$apply();</code> after the update but had the "$apply already in progress" error.</p>
  
  <p>Here is another example with a fork of a Plunker answer found <a href="https://stackoverflow.com/a/30239882/5577145">here</a>:<br>
  <a href="http://plnkr.co/edit/oOaaSQBchSktedkMRUOX?p=preview" rel="nofollow noreferrer">Original with $scope</a><br>
  <a href="http://plnkr.co/edit/MLb57Ef8Oc7kiscoa6PT?p=preview" rel="nofollow noreferrer">Mine with Controller As</a></p>
  
  <p>What can I do to update the object found by $filter ?  </p>