save settings on read mode change

This commit is contained in:
Athou
2013-03-23 23:14:14 +01:00
parent f0ac0d1722
commit 0b1241ebf9
11 changed files with 91 additions and 36 deletions

View File

@@ -2,13 +2,7 @@ var module = angular.module('commafeed.services', [ 'ngResource' ]);
module.factory('CategoryService', [ '$resource', '$http',
function($resource, $http) {
var actions = {
'get' : {
method : 'GET'
}
};
res = $resource('rest/subscriptions', {}, actions);
return res;
return $resource('rest/subscriptions');
} ]);
module.factory('EntryService', [
@@ -16,7 +10,7 @@ module.factory('EntryService', [
'$http',
function($resource, $http) {
var actions = {
'get' : {
get : {
method : 'GET',
params : {
_method : 'get'
@@ -32,4 +26,13 @@ module.factory('EntryService', [
res = $resource('rest/entries/:_method/:_type/:_id/:_readtype', {},
actions);
return res;
} ]);
} ]);
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;
});