mirror of
https://github.com/arnaucube/openEventsPlatformApp.git
synced 2026-02-07 03:36:44 +01:00
started user zone, post new event started, needs more implementation
This commit is contained in:
@@ -16,7 +16,9 @@ angular.module('app', [
|
||||
'app.byCategories',
|
||||
'app.users',
|
||||
'app.user',
|
||||
'app.login'
|
||||
'app.login',
|
||||
'app.userZone',
|
||||
'app.newEvent'
|
||||
])
|
||||
|
||||
.run(function($ionicPlatform) {
|
||||
@@ -126,6 +128,24 @@ angular.module('app', [
|
||||
controller: 'LoginCtrl'
|
||||
}
|
||||
}
|
||||
})
|
||||
.state('app.userZone', {
|
||||
url: '/userZone',
|
||||
views: {
|
||||
'menuContent': {
|
||||
templateUrl: 'templates/userZone.html',
|
||||
controller: 'UserZoneCtrl'
|
||||
}
|
||||
}
|
||||
})
|
||||
.state('app.newEvent', {
|
||||
url: '/newEvent',
|
||||
views: {
|
||||
'menuContent': {
|
||||
templateUrl: 'templates/newEvent.html',
|
||||
controller: 'NewEventCtrl'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// if none of the above states are matched, use this as the fallback
|
||||
|
||||
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);
|
||||
});
|
||||
};
|
||||
});
|
||||
8
www/js/userZone.js
Normal file
8
www/js/userZone.js
Normal file
@@ -0,0 +1,8 @@
|
||||
angular.module('app.userZone', ['pascalprecht.translate'])
|
||||
|
||||
.controller('UserZoneCtrl', function($scope, $http, $ionicModal, $timeout, $ionicLoading, $filter) {
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user