run watch page
This commit is contained in:
@@ -13,6 +13,8 @@ lunchApp.config ['$routeProvider',
|
||||
.when '/run/:id',
|
||||
templateUrl: 'templates/run.html',
|
||||
controller: 'RunCtrl'
|
||||
.otherwise
|
||||
redirectTo: '/'
|
||||
]
|
||||
|
||||
lunchApp.config ['$locationProvider',
|
||||
|
||||
@@ -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()
|
||||
]
|
||||
|
||||
@@ -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()
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user