moribvndvs / ng2-idle

Responding to idle users in Angular (not AngularJS) applications.
https://moribvndvs.github.io/ng2-idle
Apache License 2.0
315 stars 128 forks source link

Can i know the remaining idle time, once it was set. Would like to watch the idle timer decreasing lively. #92

Open anrepppp opened 6 years ago

anrepppp commented 6 years ago

I'm submitting a ... (check one with "x")

[ ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[x] support request => Please do not submit support request here, instead see https://github.com/HackedByChinese/ng2-idle/blob/master/CONTRIBUTING.md#getting-help

Current behavior

I had a requirement to know when the idle timeout was half way there before complete?

Expected behavior

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

coolvasanth commented 4 years ago

I too badly looking for this solution ? did u find anything with this regard?

dmbaker90 commented 3 years ago

This is a hacky way to do it but you can read the expiry date from local storage:

setInterval(() => { this.timeoutTime = localStorage.getItem('ng2Idle.main.expiry'); }, 1000);

<p>Expiry: {{timeoutTime | date: 'longTime'}}</p>