From 1c993c147c47c083e849b71a368d57b235ac66a1 Mon Sep 17 00:00:00 2001 From: Davide Alberani Date: Sat, 21 Mar 2015 20:31:36 +0100 Subject: [PATCH] use MongoDB ObjectId as unique IDs --- angular_app/events-list.html | 2 +- angular_app/js/controllers.js | 1 + angular_app/js/services.js | 6 +++--- angular_app/persons-list.html | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/angular_app/events-list.html b/angular_app/events-list.html index 0d56f10..d88a0ce 100644 --- a/angular_app/events-list.html +++ b/angular_app/events-list.html @@ -17,7 +17,7 @@ diff --git a/angular_app/js/controllers.js b/angular_app/js/controllers.js index 26cf9e7..204e481 100644 --- a/angular_app/js/controllers.js +++ b/angular_app/js/controllers.js @@ -3,6 +3,7 @@ /* Controllers */ var eventManControllers = angular.module('eventManControllers', []); + eventManControllers.controller('navigation', ['$location', function ($location) { this.go = function(url) { diff --git a/angular_app/js/services.js b/angular_app/js/services.js index 0ce0c79..6d0b352 100644 --- a/angular_app/js/services.js +++ b/angular_app/js/services.js @@ -2,7 +2,7 @@ var eventManServices = angular.module('eventManServices', ['ngResource']); eventManServices.factory('Event', ['$resource', function($resource) { - return $resource('events/:id', {id: '@id'}, { + return $resource('events/:id', {id: '@_id'}, { all: { method: 'GET', isArray: true, @@ -18,10 +18,10 @@ eventManServices.factory('Event', ['$resource', eventManServices.factory('Person', ['$resource', function($resource) { - return $resource('persons/:id', {id: '@id'}, { + return $resource('persons/:id', {id: '@_id'}, { all: { method: 'GET', - isArray:true, + isArray: true, transformResponse: function(data, headers) { return angular.fromJson(data).persons; } diff --git a/angular_app/persons-list.html b/angular_app/persons-list.html index c4f4e85..9c94672 100644 --- a/angular_app/persons-list.html +++ b/angular_app/persons-list.html @@ -17,7 +17,7 @@