Create order fixes

This commit is contained in:
Ben Ramey
2014-04-14 11:35:11 -05:00
parent a3068166e3
commit c9a8377061
47 changed files with 45314 additions and 2 deletions

View File

@@ -0,0 +1,30 @@
var CreateRunController, lunchControllers;
lunchControllers = angular.module('lunchControllers');
lunchControllers.controller('CreateRunCtrl', [
'$scope', '$http', '$location', 'socket', CreateRunController = function($scope, $http, $location, socket) {
$scope.run = {
invitees: []
};
$scope.addInvitee = function() {
return $scope.run.invitees.push({});
};
$scope.removeInvitee = function(index) {
return $scope.run.invitees.splice(index, 1);
};
$scope.create = function(run) {
var data;
data = angular.copy(run);
data.invitees.push({
name: data.creatorName,
email: data.creatorEmail
});
return socket.post('/run', data, function(response) {
$location.path('/run/' + response.id);
return $scope.$apply();
});
};
return $scope.addInvitee();
}
]);