mirror of
https://github.com/lukevella/rallly.git
synced 2025-06-08 13:41:51 +02:00
Update
- updated styles - added edit functionality
This commit is contained in:
parent
2630cc237a
commit
b72dfc474e
21 changed files with 136 additions and 52 deletions
|
@ -1,13 +1,22 @@
|
|||
angular.module('rallly')
|
||||
.controller('EventCtrl', function($scope, $http, $state, Event, Participant){
|
||||
|
||||
var id = $state.params.id;
|
||||
$scope.event = Event.get({id:id});
|
||||
$scope.deleteParticipant = function(pid){
|
||||
Participant.remove({ id : id , pid : pid }, function(event){
|
||||
$scope.event = event;
|
||||
});
|
||||
$scope.deleteParticipant = function(participant){
|
||||
if (confirm("Are you sure you want to remove "+participant.name+"?")){
|
||||
Participant.remove({ id : id , pid : participant._id }, function(event){
|
||||
$scope.event = event;
|
||||
});
|
||||
}
|
||||
}
|
||||
$scope.edit = function(index){
|
||||
|
||||
}
|
||||
|
||||
$scope.update = function(participant){
|
||||
Event.update({'_id':$scope.event.id}, $scope.event);
|
||||
}
|
||||
|
||||
$scope.save = function(participant){
|
||||
var participant = new Participant(participant);
|
||||
participant.$save({id:id}, function(event){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue