More workflow

This commit is contained in:
Ben Ramey
2014-03-14 21:50:36 -05:00
parent fc0ed457a6
commit ce4b9d4d50
7 changed files with 37 additions and 9 deletions

View File

@@ -3,19 +3,18 @@ lunchControllers = angular.module 'lunchControllers'
lunchControllers.controller 'CreateRunCtrl', ['$scope', '$http', '$location', 'socket',
CreateRunController = ($scope, $http, $location, socket) ->
$scope.run =
name: 'run name',
creatorName: 'ben ramey'
creatorEmail: 'ben.ramey@gmail.com'
invitees: [{email: 'bob@bob.com'}]
invitees: [{name: 'bob', email: 'bob@bob.com'}]
restaurant: 'subway'
$scope.addInvitee = () ->
$scope.run.invitees.push { email: '' }
$scope.run.invitees.push {}
$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()
]