Rename public to www
This commit is contained in:
31
www/linker/js/controllers/create-run-controller.js
Normal file
31
www/linker/js/controllers/create-run-controller.js
Normal file
@@ -0,0 +1,31 @@
|
||||
var CreateRunController, lunchControllers;
|
||||
|
||||
lunchControllers = angular.module('lunchControllers');
|
||||
|
||||
lunchControllers.controller('CreateRunCtrl', [
|
||||
'$scope', '$http', '$location', 'socket', CreateRunController = function($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'
|
||||
};
|
||||
$scope.addInvitee = function() {
|
||||
return $scope.run.invitees.push({});
|
||||
};
|
||||
return $scope.create = function(run) {
|
||||
var data;
|
||||
data = angular.copy(run);
|
||||
return socket.post('/run', data, function(response) {
|
||||
$location.path('/run/' + response.id);
|
||||
return $scope.$apply();
|
||||
});
|
||||
};
|
||||
}
|
||||
]);
|
||||
Reference in New Issue
Block a user