Organize controllers, config
This commit is contained in:
19
assets/linker/js/controllers/create-run-controller.coffee
Normal file
19
assets/linker/js/controllers/create-run-controller.coffee
Normal file
@@ -0,0 +1,19 @@
|
||||
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'
|
||||
|
||||
$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
|
||||
]
|
||||
4
assets/linker/js/controllers/home-controller.coffee
Normal file
4
assets/linker/js/controllers/home-controller.coffee
Normal file
@@ -0,0 +1,4 @@
|
||||
lunchControllers = angular.module 'lunchControllers'
|
||||
|
||||
lunchControllers.controller 'HomeCtrl', ['$scope', ($scope) ->
|
||||
]
|
||||
1
assets/linker/js/controllers/module.coffee
Normal file
1
assets/linker/js/controllers/module.coffee
Normal file
@@ -0,0 +1 @@
|
||||
controllersModule = angular.module 'lunchControllers', []
|
||||
4
assets/linker/js/controllers/run-controller.coffee
Normal file
4
assets/linker/js/controllers/run-controller.coffee
Normal file
@@ -0,0 +1,4 @@
|
||||
lunchControllers = angular.module 'lunchControllers'
|
||||
|
||||
lunchControllers.controller 'RunCtrl', ['$scope', ($scope) ->
|
||||
]
|
||||
Reference in New Issue
Block a user