Closed baalexander closed 10 years ago
On the one hand, I agree that symmetry is good. On the other hand, depending on how frequently you pulse data through a socket (think: realtime chat), $digest/$apply might get really expensive for no good reason. Perhaps an option to enable or disable auto $digest?
Mr. @btford and I discussed it and think that listeners that handle data from the server should apply by default, but take an options object that can specify autoApply: false. E.g.
mySocket.onMessage(
function() {...},
{autoApply: false});
After receiving data from over the WebSocket, it would be great if the service also called $digest/$apply. At least, similar to what $http is doing.