mirror of
https://github.com/arnaucube/openEventsPlatformApp.git
synced 2026-02-08 12:16:39 +01:00
started user zone, post new event started, needs more implementation
This commit is contained in:
21
www/js/newEvent.js
Normal file
21
www/js/newEvent.js
Normal file
@@ -0,0 +1,21 @@
|
||||
angular.module('app.newEvent', ['pascalprecht.translate'])
|
||||
|
||||
.controller('NewEventCtrl', function($scope, $http, $ionicModal, $timeout, $ionicLoading, $filter) {
|
||||
|
||||
$scope.event={};
|
||||
$scope.event.categories=[{name: "prova"}];
|
||||
$scope.postEvent = function(){
|
||||
$http({
|
||||
url: urlapi + 'events',
|
||||
method: "POST",
|
||||
data: $scope.event
|
||||
})
|
||||
.then(function(data) {
|
||||
window.location.href="#/app/events";
|
||||
},
|
||||
function(response) { // optional
|
||||
// failed
|
||||
console.log(response);
|
||||
});
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user