My factory manages a collection that is constantly updated with new values from socket.io. I want to update a scope variable with this collection in real-time without using callbacks in the controller. Ideally, I would like to achieve this behavior similar to when using defer.resolve(collection). Although I could use defer.notify(collection), it leads to messy code like:
service.update().then(null, null, function(collection){
$scope.collection = collection()
}
This approach seems quite cumbersome. If I use promise resolve, I can simply do:
$scope.collection = service.collection()
However, this only updates the service once. How can I accomplish continuous updates using promises or another technique?