Giter VIP home page Giter VIP logo

Comments (3)

mendhak avatar mendhak commented on August 18, 2024

This is because the DOM isn't always ready (depending on use case) so the safest option is queueing the events up using $timeout. I probably blanket applied it to all the events. If you want you can try removing it then testing it a bit, though without it you may get odd Angular errors if your event handler needs to touch the DOM, so I'm not 100% confident about it.

from angular-intro.js.

city41 avatar city41 commented on August 18, 2024

I took $timeout out of the call for onbeforechange and for me angular-introjs is now behaving more like introjs does. I think at least for onbeforechange, $timeout is probably not needed.

I'll keep playing with it and I'll probably fork angular-introjs and if it proves successful for us I'll let you know.

from angular-intro.js.

rikukissa avatar rikukissa commented on August 18, 2024

Wouldn't it be possible just to first call the corresponding function and then notify the scope?

if (scope.ngIntroOnbeforechange) {
    intro.onbeforechange(function(targetElement) {
        scope.ngIntroOnbeforechange.call(this, targetElement, scope);
        scope.$digest();
    });
}

Or to be sure that digest isn't already in progress do something like
setTimeout(scope.$digest);

from angular-intro.js.

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.