Sprucing up homepage, real e-mail

This commit is contained in:
Ben Ramey
2014-03-25 22:10:41 -05:00
parent b9917e6027
commit 467a966bc8
4 changed files with 60 additions and 61 deletions

View File

@@ -3,18 +3,19 @@ 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: [{name: 'bob', email: 'bob@bob.com'}]
restaurant: 'subway'
invitees: []
$scope.addInvitee = () ->
$scope.run.invitees.push {}
$scope.removeInvitee = (index) ->
$scope.run.invitees.splice index, 1
$scope.create = (run) ->
data = angular.copy run
socket.post '/run', data, (response) ->
$location.path '/run/' + response.id
$scope.$apply()
$scope.addInvitee()
]