Organize controllers, config

This commit is contained in:
Ben Ramey
2014-03-14 10:37:15 -05:00
parent 0fbee6ecc9
commit 026d98ed23
10 changed files with 43 additions and 26 deletions

View 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
]

View File

@@ -0,0 +1,4 @@
lunchControllers = angular.module 'lunchControllers'
lunchControllers.controller 'HomeCtrl', ['$scope', ($scope) ->
]

View File

@@ -0,0 +1 @@
controllersModule = angular.module 'lunchControllers', []

View File

@@ -0,0 +1,4 @@
lunchControllers = angular.module 'lunchControllers'
lunchControllers.controller 'RunCtrl', ['$scope', ($scope) ->
]