Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get/watch the multiple multiple instances of ng2-idle #117

Open
Brunnik opened this issue Sep 21, 2018 · 1 comment
Open

How to get/watch the multiple multiple instances of ng2-idle #117

Brunnik opened this issue Sep 21, 2018 · 1 comment

Comments

@Brunnik
Copy link

Brunnik commented Sep 21, 2018

Hi all,
I want to create the multiple instances of ng2-idle in my application, one is for idle-logout after 10 mins and another is for auto saving the inputs if the application idle for 10 seconds. Right now I had created multiple instances(using setIdleName) for this case, but the timeout is happening on the last idle time I had set. Please help me to solve this issue

@lapongua
Copy link

lapongua commented Jan 17, 2019

It happens the same to me. have you solved it?

constructor(private idle: Idle,  private idle2: Idle){
idle.setIdle(1000);     // sets an idle timeout of "environment.idle_time" seconds
    idle.setTimeout(5); // sets a timeout period of "environment.timeout_time" seconds
    idle.setInterrupts(DEFAULT_INTERRUPTSOURCES); // sets the default interrupts, in this case, things like clicks, scrolls, touches to the document
    idle.setIdleName('main');

    idle2.setIdle(15);
    idle2.setTimeout(5);
    idle2.setIdleName('notifications');

console.log(this.idle.getIdle()); // Output 15
console.log(this.idle2.getIdle()); // Output 15
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants