title: Angular.js - Data from AJAX request as a ng-repeat collection
body: <p>In my web app i'm reciving data every 3-4 seconds from an AJAX call to API like this:</p>
  
  <pre><code>$http.get('api/invoice/collecting').success(function(data) {
      $scope.invoices = data
  }
  </code></pre>
  
  <p>Then displaying the data, like this: <a href="http://jsfiddle.net/geUe2/1/" rel="nofollow">http://jsfiddle.net/geUe2/1/</a></p>
  
  <p>The problem is that every time i do <code>$scope.invoices = data</code> ng-repeat rebuilds the DOM area which is presented in the jsfiddle, and i lose all <code>&lt;input&gt;</code> values. </p>
  
  <p>I've tried to do:</p>
  
  <ul>
  <li><code>angular.extend()</code></li>
  <li>deep version of <code>jQuery.extend</code></li>
  <li>some other merging\extending\deep copying functions</li>
  </ul>
  
  <p>but they can't handle the situation like this:</p>
  
  <p>On my client a have <code>[invoice1, invoice2, invoice3]</code> and server sends me <code>[invoice1, invoice3]</code>. So i need invoice2 to be deleted from the view.</p>
  
  <p>What are the ways to solve this problem?</p>