Class: Service

ngeo.statemanager.Service

new Service(ngeoLocation, ngeoUsedKeyRegexp)

Provides a service for managing the application state. The application state is written to both the URL and the local storage.

Parameters:
Name Type Description
ngeoLocation !ngeo.statemanager.Location

ngeo location service.

ngeoUsedKeyRegexp !Array.

regexp used to identify the used keys.

Members

(static, non-null) module: angular.Module

(non-null) initialState: Object:.<string:, string:>

Object representing the application's initial state.

(non-null) ngeoLocation: ngeo.statemanager.Location

(non-null) usedKeyRegexp: Array:.<!RegExp:>

Methods

deleteParam(key)

Delete a parameter

Parameters:
Name Type Description
key string

Key.

getInitialBooleanValue(key)

Get the state value for key.

Parameters:
Name Type Description
key string

State key.

Returns:
boolean|undefined

State value.

getInitialNumberValue(key)

Get the state value for key.

Parameters:
Name Type Description
key string

State key.

Returns:
number|undefined

State value.

getInitialStringValue(key)

Get the state value for key.

Parameters:
Name Type Description
key string

State key.

Returns:
string|undefined

State value.

getInitialValue(key)

Get the state value for key.

Parameters:
Name Type Description
key string

State key.

Returns:
string|undefined

State value.

setUseLocalStorage(value)

Parameters:
Name Type Description
value boolean

Use localStorage

Returns:
boolean

localStorage will be used.

updateState(object)

Update the application state with the values in object.

Parameters:
Name Type Description
object !Object.

Object.