2

Is it possible to dynamically add steps so that IntroJS can find the element after a route change ?

Basically when a certain step is loaded, I am routing to another page

this.introJs.onbeforechange((obj) => {
    if (this.introJs._currentStep === 0) {
        setTimeout(() => {
               this.router.navigate(['', { outlets: { popup: ['user'] } }]);
            }, 0);
        }

Is it at all possible to get a workaround so that, for example, in onChange or something similar I can then add a new step there, so that IntroJS can find the element ?

Naturally, I can't set up all steps initially, because it won't find the elements on the new route - has anyone come up with a solution for a seamless usage of IntroJS tour ?

I did try the this.introJs.addStep({}) function but that still executes on load so it's still too early to pick up the element in the DOM ?

thanks

yoyoma
  • 3,336
  • 6
  • 27
  • 42
  • @GRD thank you it was useful, but this is now more a question about how to tackle the tour when you need to route change – yoyoma Jan 12 '22 at 07:23
  • Thank you. So, Any route change happen then You want to show intro ? or anything else ? Means, Inside tour dialog, when I click next then route.navigate happens and then again you want to continue tour from that route ? – GRD Jan 12 '22 at 07:24

0 Answers0