Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi all,
I'm trying to build a system where we can elegantly check for user idle time and I have to do some operation based on that idle.
<a href="http://jsfiddle.net/r7zwq/25/"><a href="http://jsfiddle.net/r7zwq/25/"></a></a>[<a href="http://jsfiddle.net/r7zwq/25/" target="_blank" title="New Window">^</a>]

Check above fiddle.

1) whenever user change to dropdown value to final, i need to start a time tracker which monitors whether user is idle or not.
2) if user is idle for that time, i need to do some background activity.
3) if user changes to some other value apart from "final", then I have to unbind all events and timers attached in that controller.
4) if user changes to someother state also, I have unbind all events and timers.

Sometimes, whenever I keep switching values, system physical memory is hiking up and eventually system hangs up ):(

I know we can use ngIdle to do it. But we are already using ngIdle in whole application level to track user idle time and log user out. so its not possible to integrate it into a a specific module controller, since its a singleton.

Any swift elegant solution? Kindly provide your thoughts.

Thanks in advance.

What I have tried:

So far, done this. kindly help further.

Angular ng-change - JSFiddle[^]
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900