Closed faisalloe closed 6 years ago
When configuring idle, use AutoResume.notIdle
. This will allow user activity to reset the idle timer as long as they are NOT idle, which means that when they do go idle, you have to reset the idle service manually when they click OK as you requested.
You don't need to do anything extra, like modify or pause the interrupt sources. From the demo you linked, simply import the AutoResume
enum and add the following line to the AppComponent constructor (or your equivalent):
idle.setAutoResume(AutoResume.notIdle);
Then in your OK button click handler, just call idle.watch()
.
awesome, great help appreciated.
This is perfect. Is this documented anywhere?
Thanks for all your hard work!
Angular4 with @ng2-idle trying to capture the inactivity of the user.
code example link https://hackedbychinese.github.io/ng2-idle/
I am trying to customize it so every time user goes idle i show modal with ok button. and user will able to resume only ok is clicked on the modal.
on page load default interrupts are on
on
idleStart
i show my modal and count down begins ononIdleEnd
i close my modalwhen modal is open i want to disable
DEFAULT_INTERRUPTSOURCES
only manual interrupt so i calledidle.clearInterrupts()
and on modal ok press event callingidle.interrupt(true);
once modal is close i setidle.setInterrupts(DEFAULT_INTERRUPTSOURCES);
again.does not seems to work very well. after modal close and open again it does not car about
DEFAULT_INTERRUPTSOURCES
and onsetIdle
time it goes automiticalyidle
mode even though user interacts with the UI.