title: AngularJS: Best way to handle data from socket with ng-repeat
body: <p>I am quite new to real-time data with Socket.IO. I am trying to figure out what  is the best way to handle data coming in from Socket.IO in an AngularJS ng-repeat?</p>
  
  <p>Right now I have the backend sending up the entire data structure every time there is an update to it. </p>
  
  <p>But this is causing the <code>ng-repeat</code> to refresh in order to display the new data (if I make any modifications to the data on the client side only, they are removed next time data is sent from the backend). Is there a better way to do this? </p>
  
  <p>Should I filter out the only data that requires updating on the backend and then send that to the front end instead of delivering the entire data structure again? (But then how would I apply this in an <code>ng-repeat</code> with only the update data...)</p>
  
  <p>I tried using UnderscoreJS extend method in the frontend but it seems to cause issues with the sorting of data in <code>ng-repeat</code> (orderBy and filter both break).</p>
  
  <p>My specific use case is dealing with sports scores (several games (objects) in an array), I am constantly getting updates on my data whether they are the time changing in a game, or a scoring play. Updates are happening pretty much every second. I am tapping into this specific API and grabbing all the data on a specific refresh variable, then sending it to the front-end via a socket. Not the ideal case to use sockets really, but it is the only way to interact with the API that I have discovered so far.</p>