On Github wrozka / angular-workshop-live-updates
Paweł Pierzchała @zwrozka
Static page
$scope.wallItems = timelineService.all();
Polling
function getWallItems() { timelineService.all().then(function(items) { $scope.wallItems = items; $timeout(getWallItems, 1000); }); }
Live updates
liveTimelineService.onNewItem(...);
WebSockets
Two data binding
Angular doesn't know anything about Web Sockets
$rootScope.$apply
Implement live updated list of wall items
client = new Faye::Client('http://workshop.invaders.co:8000/faye'); client.subscribe('/wall_items', ...); client.subscribe('/users', ...);