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

documentation #2

Closed
david-gang opened this issue Mar 23, 2016 · 3 comments
Closed

documentation #2

david-gang opened this issue Mar 23, 2016 · 3 comments

Comments

@david-gang
Copy link

Hi,

It would be great to have a code snippet to see how to use the Idle service.

Thanks,
David

@moribvndvs
Copy link
Owner

Indeed, sorry. I was a little gunshy about putting one together with Angular state being in a beta flux.
Oddly enough, there is an example in the README for the ng2-idle-keepalive plugin for ng2-idle. I'll refresh with the latest Angular beta and add a sample.

@paullryan
Copy link

So on that note, what am I doing wrong with

      idle.setIdle(5);
      idle.setTimeout(5);
      idle.setInterrupts(DEFAULT_INTERRUPTSOURCES);
      idle.onIdleStart.subscribe(response => {
        console.log('idling');
        console.log(response);
      });
      idle.onIdleEnd.subscribe(response => {
        console.log('idle ended');
        console.log(response);
      });
      idle.onTimeout.subscribe(response => {
        console.log('timed out');
      });

seems like the correct direction based on your source but none of my subscribes are triggering. If I figure it out before you get back on I'll try to update here.

@BahKoo
Copy link

BahKoo commented Mar 29, 2016

I think you need to call idle.watch() to get it started.

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

4 participants