Comments (7)
You can only change the idleDuration
by using $idleProvider.idleDuration
. That of course infers that you can only configure it during .config
, and can't change it once $idle
is created and injected elsewhere.
Originally, I didn't consider a viable use case where someone would want to change the configuration on the fly. However, now that I think about it, I suppose you might have an application with an admin console where you might want to change the the values to it at runtime.
If you are interested in varying the configuration on a controller-by-controller basis (or something like that), that could be tricky and I'd have to give it some thought.
Anyways, I could duplicate the config methods on the $idle
service itself, but I'm hesitant on doing so unless it's generally useful to everyone so that I avoid bloating the module (people are very picky about size and complexity). You could fork the module and add in what you need fairly easily, though.
I will mark as won't fix, but if enough people vote for it we can reopen and address it.
from ng-idle.
+1
from ng-idle.
I ended up finding a workaround. My solution should be in my web_wallet repo.
from ng-idle.
Let me explain my use case, maybe you will see why it could be useful: We have a mobile app build with Ionic that will be installed on tablets and used as information kiosk. We use ng-idle to redirect application to language picker if we don't have any user activity. The idle duration is configurable directly in the settings of the application, so we need to change it on runtime. Currently, my workaround is to make idleProvider global, but as you can imagine, I don't really want to release the app with that trick.
from ng-idle.
For my app, I have a requirement to make session timeout configurable per user and this information is fetched from the server after login. So I want to update the idle duration through a service / controller after user session is established. I am using ngIdle but have hardcoded the value in config. Can I change it in the controller?
from ng-idle.
Never mind. I was using an older version of ngIdle. Thank.
from ng-idle.
When you guys get solutions, please post them here for everyone else
from ng-idle.
Related Issues (20)
- [Question] Keepalive event in multiple tabs
- Issue in multiple tabs HOT 2
- Angular 5 - generic component child used in several main component not working
- Not want to reset timer in case of user intervention in app HOT 1
- Any plans to upgrade to Angular 6 HOT 1
- AngularJs - Unknown provider : IdleProvider HOT 1
- ng-Idle/core onIdleStart and onTimout function executing multiple times
- Having issues with ng-idle/core onIdleEnd & Mat-Dialog HOT 1
- keepalive onPingResponse subscribe response doesnt work right
- set url string parameter of http() dynamically
- Using JS Alert does not timeout until OK is Clicked HOT 1
- Key Management: Hardcoded Encryption Key HOT 1
- Select box (with multiple selections) not working properly
- unable to mock inactivity time with cypress clock/tick()
- How to use localstorageservice to handle in multiple tabs in the same browser HOT 1
- Incompatible with Angular 10 HOT 1
- Don't work with IFRAME HOT 3
- Keepalive interval not respected
- Implement a privacy preserving mode functionality avoiding usage of the persistent browser localStorage
- ng-idle not working for iOS in Ionic cordova
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ng-idle.