grbsk / ng-idle

Responding to idle users in AngularJS applications.
http://hackedbychinese.github.io/ng-idle
MIT License
564 stars 195 forks source link

Dynamic timeout ? #189

Closed v0d1ch closed 7 years ago

v0d1ch commented 7 years ago

Is there a way to have dynamic timeout setting ? Scenario is that I have a service that fetches the timeout from backend and I want to be able to set it but I can not inject that fetcher service in config phase of the app and Idle.setTimeout(x) in run phase does not actually set my timeout properly. If I have hardcoded values like in the base example everything of course works but I think that dynamic setting would be a nice feature

grbsk commented 7 years ago

Have you called watch() after changing the timeout? setTimeout does not do that automatically.

v0d1ch commented 7 years ago

Right, working now as expected. Thanks!