run watch page

This commit is contained in:
Ben Ramey
2014-03-14 11:12:42 -05:00
parent 026d98ed23
commit 6f3d47ff6e
6 changed files with 32 additions and 3 deletions

View File

@@ -13,6 +13,8 @@ lunchApp.config ['$routeProvider',
.when '/run/:id',
templateUrl: 'templates/run.html',
controller: 'RunCtrl'
.otherwise
redirectTo: '/'
]
lunchApp.config ['$locationProvider',

View File

@@ -16,4 +16,5 @@ lunchControllers.controller 'CreateRunCtrl', ['$scope', '$http', '$location', 's
console.log response.id
console.log $location
$location.path '/run/' + response.id
$scope.$apply()
]

View File

@@ -1,4 +1,13 @@
lunchControllers = angular.module 'lunchControllers'
lunchControllers.controller 'RunCtrl', ['$scope', ($scope) ->
lunchControllers.controller 'RunCtrl', ['$scope', 'socket', '$routeParams', ($scope, socket, $routeParams) ->
$scope.show = false
socket.get '/run',
where:
id: $routeParams['id'],
(response) ->
$scope.show = true
$scope.run = response[0]
$scope.$apply()
]