Coder Social home page Coder Social logo

angular-user-idle's Introduction

Stand With Ukraine

angular-user-idle

Service for Angular 15+ to detect and control of user's idle (for previous versions use v3.0.x).

npm version

Important

The library was written for my personal needs. So I distribute it "as is" without advanced supporting and change requesting. If you like the library just use it if not then you're free to fork the repo and make what are you want.

Demo

See Demo app

Installation

npm install angular-user-idle

In app.module.ts:

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { provideUserIdleConfig } from 'angular-user-idle';
import { AppComponent } from './app.component';

@NgModule({
  imports: [BrowserModule],
  declarations: [AppComponent],
  providers: [
    // Optionally you can set time for `idle`, `timeout` and `ping` in seconds.
    // Default values: `idle` is 600 (10 minutes), `timeout` is 300 (5 minutes) 
    // and `ping` is 120 (2 minutes).
    provideUserIdleConfig({ idle: 600, timeout: 300, ping: 120 })
  ],
  bootstrap: [AppComponent]
})
export class AppModule {}

Usage

You should init user idle service in one of core component or service of your app, for example login.component.ts:

import { Component, OnInit } from '@angular/core';
import { UserIdleService } from 'angular-user-idle';

@Component({
  templateUrl: './login.component.html'
})
export class LoginComponent implements OnInit {
  constructor(private userIdle: UserIdleService) {
  }

  ngOnInit() {
    //Start watching for user inactivity.
    this.userIdle.startWatching();
    
    // Start watching when user idle is starting.
    this.userIdle.onTimerStart().subscribe(count => console.log(count));
    
    // Start watch when time is up.
    this.userIdle.onTimeout().subscribe(() => console.log('Time is up!'));
  }

  stop() {
    this.userIdle.stopTimer();
  }

  stopWatching() {
    this.userIdle.stopWatching();
  }

  startWatching() {
    this.userIdle.startWatching();
  }

  restart() {
    this.userIdle.resetTimer();
  }
}
About ping

Please note that ping is used if you want to perform some action periodically every n-minutes in lifecycle of timer (from start timer to timeout).

For example, if you want to make a request to refresh token every 2 minutes you set ping to 120 and subscribe to ping's observable like this:

this.idle.ping$.subscribe(() => console.log("PING"));

The main schema will be as follow:

|–– 2m (ping)––4m (ping) ––6m (ping)...-– 10m (user idle detected, start timer for 5 min) –- 12m (ping) –– 14m (ping) –– 15m (time is out)|

If you don't use a ping just set ping to any value (not null) and just ignore it.

API

startWatching(): void;

Start user idle service and configure it.

onTimerStart(): Observable<number>

Fired when timer is starting and return observable (stream) of timer's count.

onTimeout(): Observable<boolean>;

Fired when time is out and id user did not stop the timer.

stopTimer()

Stop timer.

resetTimer()

Reset timer after onTimeout() has been fired.

stopWatching()

Stop user idle service.

setConfigValues({idle, timeout, ping})

Set config values after module was initialized.

setCustomActivityEvents(customEvents: Observable<any>): void

Set custom activity events after module was initialized.

Service logic:
  • User is inactive for 10 minutes
  • onTimerStart() is fire and return countdown for 5 minutes
  • If user did not stop timer by stopTimer() then time is up and onTimeout() is fire.

angular-user-idle's People

Contributors

andrew-potachits avatar dependabot[bot] avatar jordan-hall avatar khaledlela avatar localpcguy avatar maw016 avatar philjones88 avatar rednez avatar sw-ms-jayeshtankariya avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular-user-idle's Issues

Angular 8 support

Are you planning to support Angular 8? I see a pull request to add support ... was hoping to get this soon.

stopWatching() does not work

Describe the bug
Calling stopWatching() fires onTimerStart() for some reason and does not stop watching. I have ping set to 2 seconds and the user idle service continues to ping.

To Reproduce
Steps to reproduce the behavior:

  1. Set ping to a low time
  2. Set onTimerStart() to log to console
  3. Start Watching
  4. Stop Watching

Expected behavior
Service stops watching, does not ping or watch for user idle anymore

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows
  • Browser: Chrome

Set Config Values

Thanks very much for this module. I would like to be able to set the config values later in the app, after I have retrieved them via ajax from a database config. (Different installations will have different timeout values.)

I can see a getConfigValue(), but no setConfig() or setConfigValue() in the code. All the values are private. Do you think you might be able to add a method to set config values? It would be greatly appreciated!

onTimerStart does not work properly in safari

I am using the onTimerStart to clock 1 minute to perform some user action.
When i do userIdle.onTimerStart().subscribe(t => { console.log(t) }); on safari on Mac, lock my computer when the session is idle then the onTimerStart does not console.log anything till the time computer is unlocked.

Where as on the other browsers the counter works properly

How to config user events

Hi,

Thanks for the package. Works as expected, and is pretty straightforward to understand.

I would like to ask you, if is there a way to set what events change the idle state. I mean, mouse clicks, mouse scroll, cursor moving, current tab is active...,etc, So I can do some logic based on those.

Thanks in advanced.

Doesn't work over IFRAME-s

Describe the bug

Doesn't work over IFRAME content.

Expected behavior

Not to timeout when the mouse or keyboard input are active inside an IFRAME.

Additional context

I have an app with IFRAME taking up the entire app area, so nothing much beside the IFRAME content, and this solution doesn't work at all.

Ping is not working when already timed out and you startWatching again

When the 'Timeout' happens, isTimeout is set to true. After that, if you call startWatching() again, the isTimeout is not resetted back to false so the ping observable will not work.

EDIT: Maybe this is intentional. Btw you only need to call resetTimer() before start watching again for it to work.

onTimeout() doesn't fire if timeout = 0

As I can understand, meaning of idle and timeout, is to be able to show to the user some warning, that some action will take place in timeout seconds.

But, because I don't need that functionality, I've tried to set { idle: 900, timeout: 0}. This broken onTimeout() subscription, it never gets any notification, so onTimeout() action is never executed.

Steps to reproduce the behavior:

  1. Configure UserIdleModule.forRoot({ idle: 5, timeout: 0, ping: 0 })
  2. Setup a subscription for onTimerStart() and onTimeout()
  3. Wait 5 seconds to see that nothing happens

Expected behavior
Should immediately execute onTimeout()

ngc BUILD ERROR

I want to use angular-user-idle in a module build with ng-packagr.

angular-user-idle contains *.ts files in the npm package so ngc tryes to compile them and failes with

angular-user-idle/user-idle.config.ts' is not under 'rootDir'

Intermittent behavior on macOS

I am using it to time out the session after an hour of inactivity. It is working perfectly with Windows OS but the behavior is intermittent on macOS.

On macOS, sometimes onTimeout method captures the timeout and other times it doesn't.

Desktop (please complete the following information):

  • OS: macOS Mojave v10.14.4
  • Browser: Chrome & Safari both

Expected behavior
It should always timeout after given idle time limit.

angular-user-idle breaks in AOT mode

Hi @rednez ,
Thank-you for this nice module. I would like to share some of the error logs I get when the application is run in AOT. Please find the snapshots attached . Please let me know if there are any work-arounds.
snapshot1
snapshot2
snapshot3

How to use if don't want any activity events to interrupt idle

If you wanted to use this service to start the idle immediately, how would this be done regarding the activityEvents observable? I plan to have http requests being the thing that will reset the timeout, by stopping watching, and then starting again.

Error when compiling in production mode on Angular 5.

Hi @rednez

Thanks for the nice module.
I get the below error when compiling in production mode on Angular 5.
I am using your v1.1.0
Can you please help?

Command used: ng build --prod --bh /sam/ --d /sam/

It works fine with the command: ng build

Cheers
Jay

ERROR in ./node_modules/angular-user-idle/user-idle.config.ts
Module build failed: Error: /var/lib/jenkins/workspace/da-sam-node-deploy/sam-client/node_modules/angular-user-idle/user-idle.config.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format (https://goo.gl/jB3GVv).
at AngularCompilerPlugin.getCompiledFile (/var/lib/jenkins/workspace/da-sam-node-deploy/sam-client/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:674:23)
at plugin.done.then (/var/lib/jenkins/workspace/da-sam-node-deploy/sam-client/node_modules/@ngtools/webpack/src/loader.js:467:39)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
ERROR in ./node_modules/angular-user-idle/user-idle.module.ts
Module build failed: Error: /var/lib/jenkins/workspace/da-sam-node-deploy/sam-client/node_modules/angular-user-idle/user-idle.module.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format (https://goo.gl/jB3GVv).
at AngularCompilerPlugin.getCompiledFile (/var/lib/jenkins/workspace/da-sam-node-deploy/sam-client/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:674:23)
at plugin.done.then (/var/lib/jenkins/workspace/da-sam-node-deploy/sam-client/node_modules/@ngtools/webpack/src/loader.js:467:39)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
ERROR in ./node_modules/angular-user-idle/user-idle.service.ts
Module build failed: Error: /var/lib/jenkins/workspace/da-sam-node-deploy/sam-client/node_modules/angular-user-idle/user-idle.service.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format (https://goo.gl/jB3GVv).
at AngularCompilerPlugin.getCompiledFile (/var/lib/jenkins/workspace/da-sam-node-deploy/sam-client/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:674:23)
at plugin.done.then (/var/lib/jenkins/workspace/da-sam-node-deploy/sam-client/node_modules/@ngtools/webpack/src/loader.js:467:39)
at
at process._tickCallback (internal/process/next_tick.js:188:7)

unwanted change detection on ngIf

Hi,
if i implement a ngIf with a function call it will be called every second.
I use the version 2.1.1 which included the issue:
#31 the interval logic causes change detection every second

For example i supplemented the angular-user-idle-master project:

<mat-card-header *ngIf="test()">Timer...

in TimerComponent:
test(): boolean { console.log('***** called *****'); return true; }

This function is called every second.

SyntaxError: Unexpected token <

getting a "SyntaxError: Unexpected token <" error when importing module

still getting the error after adding the following in package.config.ts:

let angular_user_idle: ExtendPackages[] = [{
name: 'angular-user-idle',
path: 'node_modules/angular-user-idle/user-idle.umd.js'
}];

let additionalPackages: ExtendPackages[] = [

  ...lodash,
  ...angular_user_idle
];

this.addPackagesBundles(additionalPackages);

feat: make some internal observables as public instead of protected

I'm refering to the following:

    protected timerStart$: Subject<boolean>;
    protected timeout$: Subject<boolean>;
    protected idle$: Observable<any>;

As they are protected I can use them across components where startWatching() wasn't called, which limit the module usage.

Error in AOT mode

Following errors appear when building in AOT mode:

�[0m�[1m�[31mERROR in ./node_modules/angular-user-idle/user-idle.config.ts�[39m�[22m�[0m
�[0m�[1m�[31mModule build failed: Error: *************/node_modules/angular-user-idle/user-idle.config.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.�[39m�[22m�[0m
�[0m�[1m�[31mThe missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format (https://goo.gl/jB3GVv).�[39m�[22m�[0m
�[0m�[1m�[31m    at AngularCompilerPlugin.getCompiledFile (**********/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:674:23)�[39m�[22m�[0m
�[0m�[1m�[31m    at plugin.done.then (**********/node_modules/@ngtools/webpack/src/loader.js:467:39)�[39m�[22m�[0m
�[0m�[1m�[31m    at <anonymous>�[39m�[22m�[0m
�[0m�[1m�[31m    at process._tickCallback (internal/process/next_tick.js:160:7)�[39m�[22m�[0m
�[0m�[1m�[31mERROR in ./node_modules/angular-user-idle/user-idle.module.ts�[39m�[22m�[0m
�[0m�[1m�[31mModule build failed: Error: **********/node_modules/angular-user-idle/user-idle.module.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.�[39m�[22m�[0m
�[0m�[1m�[31mThe missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format (https://goo.gl/jB3GVv).�[39m�[22m�[0m
�[0m�[1m�[31m    at AngularCompilerPlugin.getCompiledFile (**********/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:674:23)�[39m�[22m�[0m
�[0m�[1m�[31m    at plugin.done.then (**********/node_modules/@ngtools/webpack/src/loader.js:467:39)�[39m�[22m�[0m
�[0m�[1m�[31m    at <anonymous>�[39m�[22m�[0m
�[0m�[1m�[31m    at process._tickCallback (internal/process/next_tick.js:160:7)�[39m�[22m�[0m
�[0m�[1m�[31mERROR in ./node_modules/angular-user-idle/user-idle.service.ts�[39m�[22m�[0m
�[0m�[1m�[31mModule build failed: Error: **********/node_modules/angular-user-idle/user-idle.service.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.�[39m�[22m�[0m
�[0m�[1m�[31mThe missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format (https://goo.gl/jB3GVv).�[39m�[22m�[0m
�[0m�[1m�[31m    at AngularCompilerPlugin.getCompiledFile (**********/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:674:23)�[39m�[22m�[0m
�[0m�[1m�[31m    at plugin.done.then (**********/node_modules/@ngtools/webpack/src/loader.js:467:39)�[39m�[22m�[0m
�[0m�[1m�[31m    at <anonymous>�[39m�[22m�[0m
�[0m�[1m�[31m    at process._tickCallback (internal/process/next_tick.js:160:7)�[39m�[22m�[0m

Module build failed: Error: /home/karuppaswamy/damico/AdalSample/node_modules/angular-user-idle/user-idle .config.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'f iles' or 'include' property

"@amcharts/amcharts3-angular": "^1.2.0",
"@angular/animations": "^5.2.3",
"@angular/common": "^5.2.3",
"@angular/compiler": "^5.2.3",
"@angular/core": "^5.2.3",
"@angular/forms": "^5.2.3",
"@angular/http": "^5.2.3",
"@angular/platform-browser": "^5.2.3",
"@angular/platform-browser-dynamic": "^5.2.3",
"@angular/router": "^5.2.3",
"angular-user-idle": "^1.1.0",

How to use with Lazy loaded module

My folder structure is something like this with nested feature modules with lazy loading. Where do I put the import? I tried using it as in the example but did not work.

image

I have used the import inside the parent module and then used service inside the child component

Expose timeout$ or isUserIdle property.

For my implementation it would be very useful to know if the user has been inactive before performing the token renewal (on ping$ subscription).
You have a property (isUserIdle) and an observable (timeout$) that could be very useful for it, but both are private. Do you think it would be useful to expose it?

window is not defined on angular 6 universal ssr

Hi,

I'm using last angular 6 universal server side rendering.
I have problem with the server side - window is not defined

you can fix it by wrap your code and check isPlatformBrowser(platformId)

Angular package format error

got this error while creating build with this command ( node --max_old_space_size=10240 ./node_modules/.bin/ng build -e qa -prod -aot -vc -cc -dop –buildOptimizer )

node_modules/angular-user-idle/user-idle.config.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the libraryrepository to alert its author and ask them to package the library using the Angular Package Format (https://goo.gl/jB3GVv).

Getting eslint errors

Having problem with two lint rules "no-inferrable-types": [true], "arrow-parens": [true].

Both are from ./node_modules/angular-user-idle/user-idle.service.ts.

Errors are as follows.
Type number trivially inferred from a number literal, remove type annotation
Parentheses are required around the parameters of an arrow function definition

Version: 1.1.0 (Angular5)

onTimeout() Is Not Working

onTimeout won't trigger without subscribing onTimeStart(). You have to add subscribe() for onTimeStart, if not, UserIdle's never expired.

Service error @angular/core": "5.2.3"

Hi, I am getting this warning while compiling 240:149-155 "export 'inject' was not found in '@angular/core'. The page fails to load.
Any help will be appreciated

is not working in 5.2.3

index.js:176:5
TypeError: Object(...) is not a function

"@amcharts/amcharts3-angular": "^1.2.0",
"@angular/animations": "^5.2.3",
"@angular/common": "^5.2.3",
"@angular/compiler": "^5.2.3",
"@angular/core": "^5.2.3",
"@angular/forms": "^5.2.3",
"@angular/http": "^5.2.3",
"@angular/platform-browser": "^5.2.3",
"@angular/platform-browser-dynamic": "^5.2.3",
"@angular/router": "^5.2.3",
"angular-user-idle": "^2.0.0",
"@angular/cli": "^1.7.4",
"@angular/compiler-cli": "^5.2.3",

Does not work when browser is in background

Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:

  1. Run the application in Chrome browser
  2. Start the timer on some action and set timeout lets say 10 minutes
  3. Minimize the browser for more than 10 minutes
  4. Check the browser again, it is not firing Timeout event.

Expected behavior
Timeout event should fire even when Chrome is in background or relevant tab is not in focus.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows
  • Browser: chrome
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version: 74( Chrome), 2.1.2( angular-user-idle)

Additional context
Add any other context about the problem here.

ng build --prod error related to angular-user-idle

Hello,

I am trying to run ng build --prod command, and the build fails at about 92% with the following error:

ERROR in ./node_modules/angular-user-idle/user-idle.config.ts
Module build failed: Error: /Users/katya/Documents/Brinqa/brinqa-core/brinqa-app/src/main/client/node_modules/angular-user-idle/user-idle.config.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format (https://goo.gl/jB3GVv).
    at AngularCompilerPlugin.getCompiledFile (/Users/katya/Documents/Brinqa/brinqa-core/brinqa-app/src/main/client/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:740:23)
    at plugin.done.then (/Users/katya/Documents/Brinqa/brinqa-core/brinqa-app/src/main/client/node_modules/@ngtools/webpack/src/loader.js:41:31)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:118:7)

Here is some information about my environment:

Angular CLI: 6.1.1
Node: 9.8.0
OS: darwin x64
Angular: 6.1.0

We use "angular-user-idle": "^1.1.0"
Let me know if there's any additional information you might need. Thanks!

can start watching work globally

can we call this.userIdle.startWatching() once work for all component , right now it work on particular component and it can work on when i reload page not when route

Got this error

The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format (https://goo.gl/jB3GVv).

Timestart Accuracy

Hello, I have this configuration:
let mii: number = 120;
this.userIdle.setConfigValues({ idle: mii, timeout: mii - (mii * 0.8), ping: mii / 2 });

an this is the event mapping :
PING: -------Tue Feb 19 2019 12:24:06
PING: -------Tue Feb 19 2019 12:25:06

Modal: ---- Tue Feb 19 2019 12:25:18
PING: -------Tue Feb 19 2019 12:26:06
PING: -------Tue Feb 19 2019 12:27:06
PING: -------Tue Feb 19 2019 12:28:06

Modal: ---- Tue Feb 19 2019 12:28:08
PING: -------Tue Feb 19 2019 12:29:06
PING: -------Tue Feb 19 2019 12:30:06
PING: -------Tue Feb 19 2019 12:31:06
PING: -------Tue Feb 19 2019 12:32:06
PING: -------Tue Feb 19 2019 12:33:06

Modal: ---- Tue Feb 19 2019 12:33:27
PING: -------Tue Feb 19 2019 12:34:06
PING: -------Tue Feb 19 2019 12:35:06

Modal: ---- Tue Feb 19 2019 12:35:45
PING: -------Tue Feb 19 2019 12:36:06
PING: -------Tue Feb 19 2019 12:37:06

Modal: ---- Tue Feb 19 2019 12:37:49
PING: -------Tue Feb 19 2019 12:38:06
PING: -------Tue Feb 19 2019 12:39:06
PING: -------Tue Feb 19 2019 12:40:06

Modal: ---- Tue Feb 19 2019 12:40:16
PING: -------Tue Feb 19 2019 12:41:06
PING: -------Tue Feb 19 2019 12:42:06
PING: -------Tue Feb 19 2019 12:43:06
PING: -------Tue Feb 19 2019 12:44:06

The idea is every 2 ping modal comes out, but it is not happening.
Any help?

Feature Request: Ability to omit `ping` from the configuration

In my app, I have no use for the ping feature, so I'd like to configure this module like this:

UserIdleModule.forRoot({idle: 300, timeout: 30}),

But this causes an error

Property 'ping' is missing in type '{ idle: number; timeout: number; }' but required in type 'UserIdleConfig'

So, I'm forced to provide a value for a feature I'm not using, which is potentially confusing for other developers

UserIdleModule.forRoot({idle: 300, timeout: 30, ping: 0}),

I see that ping has a default value set here, so it seems like a simple ? could be added the typedefs here to make this parameter optional when configuring the module. In fact... why not all of them? They all have default values, why not make use of them instead of always forcing developers to never use these values and provide their own?

It doesn't work under Windows(x64)

angular-user-idle doesn't work under Chrome (70.0.3538.77)/Windows(x64) but it works properly under Linux and Mac using the same browser. How to fix it?

Cannot use with AOT (angular-cli)

Angular 4
Using angular-cli

I receive errors when running a production AOT build: ng build -prod -aot.
My node_modules folder is located in a directory above /src.

Errors:
`ERROR in ./src/$$_gendir/app/core/app.module.ngfactory.ts

Module not found: Error: Can't resolve 'angular-user-idle/user-idle.config' in

'/path/to/code/src/$$_gendir/app/core'
resolve 'angular-user-idle/user-idle.config' in '/path/to/code/src/$$_gendir/app/core'

Parsed request is a module
using description file: /path/to/code/package.json (relative path: ./src/$$_gendir/app/core)
Field 'browser' doesn't contain a valid alias configuration
after using description file: /path/to/code/package.json (relative path: ./src/$$_gendir/app/core)
resolve as module
/path/to/code/src/$$_gendir/app/core/node_modules doesn't exist or is not a directory
...`

Parallel Tab Open problem

If I configured Logged out code at time of timeout. Then Problems are coming at time of application is open in multiple tabs. If user is active in one tab but idle in other tab then user is logged out so current active tab facing problem of token.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.