basic REST services
This commit is contained in:
parent
212ceba267
commit
4e7fff358e
1 changed files with 31 additions and 0 deletions
31
angular_app/js/services.js
vendored
Normal file
31
angular_app/js/services.js
vendored
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
var eventManServices = angular.module('eventManServices', ['ngResource']);
|
||||||
|
|
||||||
|
eventManServices.factory('Event', ['$resource',
|
||||||
|
function($resource) {
|
||||||
|
return $resource('events/:eventID', {eventID: '@eventID'}, {
|
||||||
|
all: {
|
||||||
|
method: 'GET',
|
||||||
|
isArray:true,
|
||||||
|
transformResponse: function(data, headers) {
|
||||||
|
return angular.fromJson(data).events;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}]
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
eventManServices.factory('Person', ['$resource',
|
||||||
|
function($resource) {
|
||||||
|
return $resource('persons/:personID', {personID: '@personID'}, {
|
||||||
|
all: {
|
||||||
|
method: 'GET',
|
||||||
|
isArray:true,
|
||||||
|
transformResponse: function(data, headers) {
|
||||||
|
return angular.fromJson(data).persons;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}]
|
||||||
|
);
|
||||||
|
|
Loading…
Reference in a new issue