mirror of
https://github.com/lukevella/rallly.git
synced 2025-06-08 05:31:51 +02:00
Improved inline edit feature
This commit is contained in:
parent
10c035e359
commit
0eeb4866f4
10 changed files with 65 additions and 21 deletions
|
@ -1,7 +1,9 @@
|
|||
angular.module('rallly')
|
||||
.controller('EventCtrl', function($scope, $http, $state, Event, Participant){
|
||||
var id = $state.params.id;
|
||||
$scope.event = Event.get({id:id});
|
||||
$scope.event = Event.get({id:id}, function(data){}, function(e){
|
||||
$state.go('notfound');
|
||||
});
|
||||
$scope.delete = function(participant){
|
||||
if (confirm("Are you sure you want to remove "+participant.name+"?")){
|
||||
Participant.remove({ id : id , pid : participant._id }, function(event){
|
||||
|
@ -12,7 +14,11 @@ angular.module('rallly')
|
|||
$scope.defaults = [];
|
||||
|
||||
$scope.update = function(participant){
|
||||
Event.update({'_id':$scope.event.id}, $scope.event);
|
||||
Participant.update({
|
||||
id : $scope.event._id,
|
||||
pid : participant._id
|
||||
}, participant);
|
||||
// Event.update({'_id':$scope.event.id}, $scope.event);
|
||||
}
|
||||
$scope.edit = function(participant){
|
||||
$scope.defaults[$scope.event.participants.indexOf(participant)] = angular.copy(participant);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue