aboutsummaryrefslogtreecommitdiffstats
path: root/src/services.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/services.js')
-rw-r--r--src/services.js35
1 files changed, 9 insertions, 26 deletions
diff --git a/src/services.js b/src/services.js
index a0317f20..f6dc931d 100644
--- a/src/services.js
+++ b/src/services.js
@@ -429,35 +429,18 @@ angularService('$cookies', function($browser) {
angularService('$sessionStore', function($store) {
- function SessionStore() {}
-
- SessionStore.prototype.get = function(key) {
- return fromJson($store[key]);
- };
+ return {
+ get: function(key) {
+ return fromJson($store[key]);
+ },
- SessionStore.prototype.getAll = function() {
- var all = {},
- key;
+ put: function(key, value) {
+ $store[key] = toJson(value);
+ },
- for (key in $store) {
- if (!$store.hasOwnProperty(key)) continue;
- all[key] = fromJson($store[key]);
+ remove: function(key) {
+ delete $store[key];
}
-
- return all;
- };
-
-
- SessionStore.prototype.put = function(key, value) {
- $store[key] = toJson(value);
- };
-
-
- SessionStore.prototype.remove = function(key) {
- delete $store[key];
};
-
- return new SessionStore();
-
}, {inject: ['$cookies']});