12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- angular.module('pascalprecht.translate')
- /**
- * @ngdoc object
- * @name pascalprecht.translate.$translateCookieStorage
- * @requires $cookieStore
- *
- * @description
- * Abstraction layer for cookieStore. This service is used when telling angular-translate
- * to use cookieStore as storage.
- *
- */
- .factory('$translateCookieStorage', ['$cookieStore', function ($cookieStore) {
- var $translateCookieStorage = {
- /**
- * @ngdoc function
- * @name pascalprecht.translate.$translateCookieStorage#get
- * @methodOf pascalprecht.translate.$translateCookieStorage
- *
- * @description
- * Returns an item from cookieStorage by given name.
- *
- * @param {string} name Item name
- * @return {string} Value of item name
- */
- get: function (name) {
- return $cookieStore.get(name);
- },
- /**
- * @ngdoc function
- * @name pascalprecht.translate.$translateCookieStorage#set
- * @methodOf pascalprecht.translate.$translateCookieStorage
- *
- * @description
- * Sets an item in cookieStorage by given name.
- *
- * @param {string} name Item name
- * @param {string} value Item value
- */
- set: function (name, value) {
- $cookieStore.put(name, value);
- }
- };
- return $translateCookieStorage;
- }]);
|