started user zone, post new event started, needs more implementation

This commit is contained in:
arnaucode
2017-02-21 22:39:52 +01:00
parent c9ee46d739
commit c41f5e016d
7 changed files with 127 additions and 1 deletions

View File

@@ -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
View 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
View File

@@ -0,0 +1,8 @@
angular.module('app.userZone', ['pascalprecht.translate'])
.controller('UserZoneCtrl', function($scope, $http, $ionicModal, $timeout, $ionicLoading, $filter) {
});