AngularJS Service wrapper for localDataStorage angular plugin and global data store
Members
(private, inner) data :Object
Stored local data object.
- Source:
Type:
- 
            
Object
(private, inner) defaultData :Object
Stored default value for local data object.
- Source:
Type:
- 
            
Object
Methods
(static) getDataObject() → {Object}
Get the stored local data object.
- Source:
Returns:
- Type:
- 
        
Object
(static) setDefaultData(obj)
Set a default value for the stored local data object.
- Source:
Parameters:
| Name | Type | Description | 
|---|---|---|
| obj | Object | 
(static) resetDataToDefault()
Reset the local data object to the default value.
- Source:
(static) setLocalStorageData(key, val)
Set data in localStorage only.
- Source:
Parameters:
| Name | Type | Description | 
|---|---|---|
| key | string | |
| val | * | 
(static) setData(key, val, localStorageopt)
Set data in stored local data (and optionally localStorage).
- Source:
Parameters:
| Name | Type | Attributes | Default | Description | 
|---|---|---|---|---|
| key | string | |||
| val | * | |||
| localStorage | boolean | <optional> | false | 
(static) getLocalStorageData(key) → {*}
Get data from localStorage only.
- Source:
Parameters:
| Name | Type | Description | 
|---|---|---|
| key | string | 
Returns:
- Type:
- 
        
*
(static) getData(key) → {*}
Get data from stored local data (falling back to localStorage).
- Source:
Parameters:
| Name | Type | Description | 
|---|---|---|
| key | string | 
Returns:
- Type:
- 
        
*
(static) increment(key, val, localStorageopt)
Increment a number value in stored local data (and optionally localStorage).
- Source:
Parameters:
| Name | Type | Attributes | Default | Description | 
|---|---|---|---|---|
| key | string | |||
| val | * | |||
| localStorage | boolean | <optional> | false | 
(static) removeData(key)
Remove data from stored local data and localStorage
- Source:
Parameters:
| Name | Type | Description | 
|---|---|---|
| key | string | 
(static) setCookieData(key, val, daysopt)
Set a cookie with a duration. Also updates stored local data.
- Source:
Parameters:
| Name | Type | Attributes | Default | Description | 
|---|---|---|---|---|
| key | string | |||
| val | * | |||
| days | number | <optional> | 7 | 
(static) getCookieData(key) → {*}
Get cookie data from browser (falling back to stored local data).
- Source:
Parameters:
| Name | Type | Description | 
|---|---|---|
| key | string | 
Returns:
- Type:
- 
        
*
(static) removeCookieData(key)
Remove cookie data.
- Source:
Parameters:
| Name | Type | Description | 
|---|---|---|
| key | string | 
(static) clearLocalStorage()
Clear localStorage only.
- Source:
(static) clearAll()
Clear all stored local data, localStorage, and cookies.
- Source: