ngx-inactivity-detector
Angular (6.x+) directive to handle user inactivity
Installation
Using NPM:
npm install ngx-inactivity-detector --save
Requirements
Usage
In your app.module file:
;
In your app.component.html file:
In your app.component.ts file
Options
-
[ngxInactivityDetector] - inactivity timeout in minutes (10 minutes by defualt)
-
[debounceTime] - delay between each reset event in milliseconds (1000 by default)
-
[resetEvents] - list of events which triggers reset timeout (['mousedown', 'mousemove', 'touchend', 'touchmove','wheel', 'keypress' ] by default)
-
(inactivityTimeout) - event emitter to handle inactivity callback
-
(timerReset) - event emitter whenever the inactivity timer resets
Examples
- Add callback "timeout" after 15 minutes of user's inactivity:
...