Coder Social home page Coder Social logo

Comments (7)

moribvndvs avatar moribvndvs commented on August 19, 2024

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.

henyana avatar henyana commented on August 19, 2024

+1

from ng-idle.

nikakhov avatar nikakhov commented on August 19, 2024

I ended up finding a workaround. My solution should be in my web_wallet repo.

from ng-idle.

pvledoux avatar pvledoux commented on August 19, 2024

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.

sheetalkanade avatar sheetalkanade commented on August 19, 2024

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.

sheetalkanade avatar sheetalkanade commented on August 19, 2024

Never mind. I was using an older version of ngIdle. Thank.

from ng-idle.

atljoseph avatar atljoseph commented on August 19, 2024

When you guys get solutions, please post them here for everyone else

from ng-idle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.