Updated editing of event

This commit is contained in:
Luke Vella 2015-01-12 23:31:55 +01:00
parent 6b1e9893e9
commit bc1e25377c
16 changed files with 197 additions and 36 deletions

View file

@ -2,7 +2,13 @@ angular.module('rallly')
.controller('EventCtrl', function($scope, $http, $state, Event, Participant){
$(".nav-link").removeClass('active');
var id = $state.params.id;
$scope.event = Event.get({id:id}, function(data){}, function(e){
$scope.event = Event.get({id:id}, function(data){
$scope.eventUrl = $state.href('event', {
id: $scope.event._id
}, {
absolute : true
});
}, function(e){
$state.go('notfound');
});
$scope.delete = function(participant){
@ -14,6 +20,10 @@ angular.module('rallly')
}
$scope.defaults = [];
$scope.editEvent = function(){
$state.go('editevent', { id : $scope.event._id });
}
$scope.update = function(participant){
Participant.update({
id : $scope.event._id,