Rearrange controllers
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
lunchControllers = angular.module 'lunchControllers'
|
||||
|
||||
lunchControllers.controller 'CreateOrderCtrl', ['$scope','socket','$routeParams', ($scope, socket, $routeParams) ->
|
||||
$scope.show = false
|
||||
lunchControllers.controller 'CreateOrderCtrl', ['$scope','socket','$routeParams',
|
||||
CreateOrderController = ($scope, socket, $routeParams) ->
|
||||
$scope.show = false
|
||||
|
||||
socket.get '/run/' + $routeParams['id'],
|
||||
(response) ->
|
||||
$scope.show = true
|
||||
$scope.invitee = _.find response.invitees, (i) -> i.name.toLowerCase() == $routeParams['inviteeName']
|
||||
$scope.$apply()
|
||||
socket.get '/run/' + $routeParams['id'],
|
||||
(response) ->
|
||||
$scope.show = true
|
||||
$scope.invitee = _.find response.invitees, (i) -> i.name.toLowerCase() == $routeParams['inviteeName']
|
||||
$scope.$apply()
|
||||
]
|
||||
|
||||
@@ -1,20 +1,21 @@
|
||||
lunchControllers = angular.module 'lunchControllers'
|
||||
|
||||
lunchControllers.controller 'CreateRunCtrl', ['$scope', '$http', '$location', 'socket', ($scope, $http, $location, socket) ->
|
||||
$scope.run =
|
||||
creatorName: 'ben ramey'
|
||||
creatorEmail: 'ben.ramey@gmail.com'
|
||||
invitees: [{email: 'bob@bob.com'}]
|
||||
restaurant: 'subway'
|
||||
lunchControllers.controller 'CreateRunCtrl', ['$scope', '$http', '$location', 'socket',
|
||||
CreateRunController = ($scope, $http, $location, socket) ->
|
||||
$scope.run =
|
||||
creatorName: 'ben ramey'
|
||||
creatorEmail: 'ben.ramey@gmail.com'
|
||||
invitees: [{email: 'bob@bob.com'}]
|
||||
restaurant: 'subway'
|
||||
|
||||
$scope.addInvitee = () ->
|
||||
$scope.run.invitees.push { email: '' }
|
||||
$scope.addInvitee = () ->
|
||||
$scope.run.invitees.push { email: '' }
|
||||
|
||||
$scope.create = (run) ->
|
||||
data = angular.copy run
|
||||
socket.post '/run', data, (response) ->
|
||||
console.log response.id
|
||||
console.log $location
|
||||
$location.path '/run/' + response.id
|
||||
$scope.$apply()
|
||||
$scope.create = (run) ->
|
||||
data = angular.copy run
|
||||
socket.post '/run', data, (response) ->
|
||||
console.log response.id
|
||||
console.log $location
|
||||
$location.path '/run/' + response.id
|
||||
$scope.$apply()
|
||||
]
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
lunchControllers = angular.module 'lunchControllers'
|
||||
|
||||
lunchControllers.controller 'HomeCtrl', ['$scope', ($scope) ->
|
||||
lunchControllers.controller 'HomeCtrl', ['$scope',
|
||||
HomeController = ($scope) ->
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user