lunchControllers = angular.module 'lunchControllers' lunchControllers.controller 'RunCtrl', ['$scope', 'socket', '$routeParams', ($scope, socket, $routeParams) -> $scope.show = false socket.get '/run/' + $routeParams['id'], (response) -> $scope.show = true $scope.run = response $scope.$apply() socket.on 'message', (m) -> if m.verb is 'update' and m.id is $routeParams.id $scope.run = m.data $scope.$apply() ]