GithubHelp home page GithubHelp logo

Multiple timers with id about angular-timer HOT 7 CLOSED

siddii avatar siddii commented on June 14, 2024 3
Multiple timers with id

from angular-timer.

Comments (7)

willyyr avatar willyyr commented on June 14, 2024 2

Ok thanks for your help. Would be great if in a future version we could just use the normal $broadcast('timer-stop') with an id instead of using the DOM method.

from angular-timer.

shubhamkumarnayak avatar shubhamkumarnayak commented on June 14, 2024 1

I need the exact thing, not only for start stop to broadcast using id also.....

from angular-timer.

siddii avatar siddii commented on June 14, 2024

Yes, you can control them through ids. Its just a DOM method $('#timer1')[0].start(); and
$('#timer2')[0].stopt(); should work independently.

I remember writing a plunkr for that. But, I couldn't find it faster. So, try that & let me know if it works.

from angular-timer.

willyyr avatar willyyr commented on June 14, 2024

It's working when using:

$('timer')[x].start();
$('timer')[x].stop(); 

Would you recommend doing this from an angular controller?

from angular-timer.

siddii avatar siddii commented on June 14, 2024

May be...

But, from a controller I would create separate controllers for each timer directive(if not too many) or create an isolated scope & control it from there.

from angular-timer.

siddii avatar siddii commented on June 14, 2024

Yes, the problem is I don't want too much DOM logic inside this directive. May be it makes sense in this case.

from angular-timer.

bayucandra avatar bayucandra commented on June 14, 2024

I have tried the latest version looks it is not working with $('timer')[0].start().

It said: "Uncaught TypeError: $(...)[0].start is not a function".

I am using it inside "Angular ui router" is it the one which caused the problem?

Any help is appreciated. Thanks.

from angular-timer.

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.