Files
lunchrun.me/assets/linker/js/controllers/run-controller.coffee
2014-03-14 21:50:36 -05:00

17 lines
502 B
CoffeeScript

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()
]