2013-03-22 09:29:30 +01:00
|
|
|
var module = angular.module('commafeed.services', [ 'ngResource' ]);
|
|
|
|
|
|
|
|
|
|
module.factory('CategoryService', [ '$resource', '$http',
|
|
|
|
|
function($resource, $http) {
|
2013-03-23 23:14:14 +01:00
|
|
|
return $resource('rest/subscriptions');
|
2013-03-22 20:51:22 +01:00
|
|
|
} ]);
|
|
|
|
|
|
2013-03-23 17:17:27 +01:00
|
|
|
module.factory('EntryService', [
|
|
|
|
|
'$resource',
|
|
|
|
|
'$http',
|
2013-03-22 20:51:22 +01:00
|
|
|
function($resource, $http) {
|
|
|
|
|
var actions = {
|
2013-03-23 23:14:14 +01:00
|
|
|
get : {
|
2013-03-22 20:51:22 +01:00
|
|
|
method : 'GET',
|
|
|
|
|
params : {
|
2013-03-23 15:52:26 +01:00
|
|
|
_method : 'get'
|
2013-03-22 20:51:22 +01:00
|
|
|
}
|
2013-03-23 17:17:27 +01:00
|
|
|
},
|
|
|
|
|
mark : {
|
|
|
|
|
method : 'GET',
|
|
|
|
|
params : {
|
|
|
|
|
_method : 'mark'
|
|
|
|
|
}
|
2013-03-22 20:51:22 +01:00
|
|
|
}
|
2013-03-23 17:17:27 +01:00
|
|
|
};
|
|
|
|
|
res = $resource('rest/entries/:_method/:_type/:_id/:_readtype', {},
|
|
|
|
|
actions);
|
|
|
|
|
return res;
|
2013-03-23 23:14:14 +01:00
|
|
|
} ]);
|
|
|
|
|
|
|
|
|
|
module.service('SettingsService', function($resource) {
|
|
|
|
|
var s = {}
|
|
|
|
|
s.settings = $resource('rest/settings/get').get();
|
|
|
|
|
s.save = function() {
|
|
|
|
|
$resource('rest/settings/save').save(s.settings);
|
|
|
|
|
};
|
|
|
|
|
return s;
|
|
|
|
|
});
|