21 lines
575 B
JavaScript
21 lines
575 B
JavaScript
var lunchControllers;
|
|
|
|
lunchControllers = angular.module('lunchControllers');
|
|
|
|
lunchControllers.controller('RunCtrl', [
|
|
'$scope', 'socket', '$routeParams', function($scope, socket, $routeParams) {
|
|
$scope.show = false;
|
|
socket.get('/run/' + $routeParams['id'], function(response) {
|
|
$scope.show = true;
|
|
$scope.run = response;
|
|
return $scope.$apply();
|
|
});
|
|
return socket.on('message', function(m) {
|
|
if (m.verb === 'update' && m.id === $routeParams.id) {
|
|
$scope.run = m.data;
|
|
return $scope.$apply();
|
|
}
|
|
});
|
|
}
|
|
]);
|