new IdleTimer()
Copy of Angular Activity Monitor. Wrapped in an AngularJS Factory to allow multiple instances.
Members
options
Configuration object.
Properties:
Name | Type | Description |
---|---|---|
enabled |
boolean
|
Is the ActivityMonitor enabled? |
keepAlive |
number
|
KeepAlive ping interval (seconds). |
inactive |
number
|
How long until user is considered inactive (seconds)? |
warning |
number
|
When to warn user nearing inactive state (at |
monitor |
number
|
How frequently to check if the user is inactive (seconds). |
disableOnInactive |
boolean
|
Whether to detach all listeners when user goes inactive. |
DOMevents |
Array.<string>
|
List of DOM events to determine user's activity. |
- Default Value:
{"enabled":false,"keepAlive":800,"inactive":900,"warning":60,"monitor":3,"disableOnInactive":true,"DOMevents":""}
- Source:
user
User activity.
Properties:
Name | Type | Description |
---|---|---|
action |
number
|
Timestamp of the users' last action. |
active |
boolean
|
Is the user considered active? |
warning |
boolean
|
Is the user in warning state? |
- Default Value:
{"action":"","active":true,"warning":false}
- Source:
Methods
(inner) subscribe(event, callback)
Subscribe to a particular event.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
event |
string
|
Event to subscribe to ( |
callback |
function
|
Callback to run on event. |
(inner) unsubscribe(event, callbackopt)
Unsubscribe to a particular event.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
event |
string
|
Event to unsubscribe from ( |
|
callback |
function
|
<optional> |
If no callback or namespace provided, all subscribers for the given event will be cleared. |
on(event, callback)
Subscribe to a particular event.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
event |
string
|
Event to subscribe to ( |
callback |
function
|
Callback to run on event. |
bind(event, callback)
Subscribe to a particular event.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
event |
string
|
Event to subscribe to ( |
callback |
function
|
Callback to run on event. |
off(event, callbackopt)
Unsubscribe to a particular event.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
event |
string
|
Event to unsubscribe from ( |
|
callback |
function
|
<optional> |
If no callback or namespace provided, all subscribers for the given event will be cleared. |
unbind(event, callbackopt)
Unsubscribe to a particular event.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
event |
string
|
Event to unsubscribe from ( |
|
callback |
function
|
<optional> |
If no callback or namespace provided, all subscribers for the given event will be cleared. |