ngx-inactivity
Angular (4.x+) directive to handle user inactivity. Very helpful especially in validated projects.
Installation
Using NPM:
npm install ngx-inactivity --save
Requirements
Usage
In your app.module file:
;
In your app.component.html file:
In your app.component.ts file
Options
- [ngxInactivity] - inactivity timeout in minutes (15 minutes by defualt)
- (ngxInactivityInterval) - inactivity time interval in mili seconds (1000 ms by default)
- [ngxInactivityCallback] - event emitter to handle inactivity callback
Examples
- Add callback "handleUserInactivity" after 10 minutes of user's inactivity (no mouse moves, clicks or keypresses):
Application template..