rallly/public/js/main.js
Luke Vella b72dfc474e Update
- updated styles
- added edit functionality
2015-01-12 12:09:00 +01:00

32 lines
1.1 KiB
JavaScript

angular.module('rallly', ['ui.router','ngResource','ngFx'])
.config(function($stateProvider, $urlRouterProvider, $locationProvider){
$locationProvider.html5Mode(true);
$urlRouterProvider.otherwise("/notfound")
$stateProvider
.state('index',{
url : '/',
templateUrl : 'templates/new.html',
controller : 'NewEventCtrl'
})
.state('about', {
url : '/about',
templateUrl : 'templates/about.html'
})
.state('notfound', {
url : '/notfound',
templateUrl : 'templates/notfound.html'
})
.state('event',{
url : '/:id',
templateUrl : 'templates/event.html',
controller : 'EventCtrl'
})
})
.factory('Event', function($resource){
return $resource('/api/event/:id', { id : '@_id' }, {
'update' : { method : 'PUT' }
});
})
.factory('Participant', function($resource){
return $resource('/api/event/:id/participant/:pid', { id: '@_id', pid : '@pid'});
});