harbor/static/ng/resources/js/harbor.data.js

42 lines
948 B
JavaScript
Raw Normal View History

(function() {
'use strict';
angular
.module('harbor.app')
.factory('currentUser', currentUser)
.factory('currentProjectMember', currentProjectMember);
currentUser.$inject = ['$cookies', '$timeout'];
function currentUser($cookies, $timeout) {
return {
set: function(user) {
$cookies.putObject('user', user, {'path': '/'});
},
get: function() {
return $cookies.getObject('user');
},
unset: function() {
$cookies.remove('user', {'path': '/'});
}
2016-05-23 12:29:17 +02:00
};
}
currentProjectMember.$inject = ['$cookies'];
function currentProjectMember($cookies) {
return {
set: function(member) {
$cookies.putObject('member', member, {'path': '/'});
},
get: function() {
return $cookies.getObject('member');
},
unset: function() {
$cookies.remove('member', {'path': '/'});
}
2016-05-23 12:29:17 +02:00
};
}
})();