$sessionStorage
Provides a key-value (string-object) session storage with expiry option (in minutes).
$sessionStorage($window, $location, $cacheFactory);
Param | Type | Details |
---|---|---|
$window | service | The $window service. |
$location | service | The $location service. |
$cacheFactory | service | The $cacheFactory service. |
Delete all data from session storage and cookie.
Overrides the default domain prefix.
N.B. Destroys the existing cache.
Param | Type | Details |
---|---|---|
val | string | The string to add to the persistent data prefix. |
$sessionStorage.prefix('myPrefix');
Param | Type | Details |
---|---|---|
key | String | The key of the stored data to remove. |
myApp.$inject = ['$sessionStorage'];
function myApp($sessionStorage) {
// Your app code...
}
angular
.module('myApp', ['swxSessionStorage']);