Giter Club home page Giter Club logo

Comments (13)

isaacplmann avatar isaacplmann commented on August 16, 2024

I would put a console.log where you are calling tourService.start() to make sure that you're not calling it twice. Also, are you calling tourService.initialise() with the steps?

from ngx-tour.

kulmann avatar kulmann commented on August 16, 2024

Thanks for your reply! My code looks like this:
this.tourService.events$.subscribe(console.log);
this.tourService.initialize([{
anchorId: "dashboard.first",
content: "This is an interactive tour.",
title: "Welcome",
route: "pages/dashboard"
}, {
anchorId: "dashboard.second",
content: "Look at this beautiful chart.",
title: "Chart 1",
route: "pages/dashboard"
}, {
anchorId: "dashboard.third",
content: "And here is another one!",
title: "Chart 2",
route: "pages/dashboard"
}]);
console.log("before start");
this.tourService.start();
console.log("after start");

The console output is:
{name: "initialize", value: Array(3)}
app.component.ts:59 before start
Subscriber.js:238 {name: "start", value: undefined}
app.component.ts:61 after start
Subscriber.js:238 {name: "end", value: undefined}
Any ideas?

from ngx-tour.

isaacplmann avatar isaacplmann commented on August 16, 2024

Try taking the route property off of all the steps. It might be ending the tour when it can't navigate to that route.

from ngx-tour.

isaacplmann avatar isaacplmann commented on August 16, 2024

Actually, that's probably not the problem. It's ending the tour because it can't find an anchor with an anchorId that matches the first step. The tourAnchor directive will automatically register itself in the ngOnInit method.

from ngx-tour.

kulmann avatar kulmann commented on August 16, 2024

Ok, my html template for the dashboard looks like this (ba-card is a custom component which uses a bootstrap card):

<div class="row">
<div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
<pie-chart tourAnchor="dashboard.first"></pie-chart>
</div>
</div>
<div class="row">
<ba-card class="col-xlg-6 col-xl-6 col-lg-12 col-sm-12 col-12" cardTitle="dashboard.acquisition_channels" baCardClass="traffic-panel medium-card">
<traffic-chart tourAnchor="dashboard.second"></traffic-chart>
</ba-card>
<ba-card class="col-xlg-6 col-xl-6 col-lg-12 col-md-6 col-sm-12 col-12" cardTitle="dashboard.revenue" baCardClass="medium-card">
<line-chart tourAnchor="dashboard.third"></line-chart>
</ba-card>
</div>

Is there anything else I need to do to declare tourAnchors?

from ngx-tour.

isaacplmann avatar isaacplmann commented on August 16, 2024

That should be right. Add this line before the tourService.start()

console.log(this.tourService.anchors);

from ngx-tour.

isaacplmann avatar isaacplmann commented on August 16, 2024

Maybe the tourAnchors have not hit their ngOnInit hook yet. Where are you calling tourService.start()?

from ngx-tour.

kulmann avatar kulmann commented on August 16, 2024

Your guess is correct, this.tourService.anchors is empty at the start() call. I have placed both the initialize([]) and the start() calls within the constructor of my app.component.ts. But even if I move them to ngAfterContentInit() the anchors are still empty. I will try to get that right tomorrow... thanks a lot for your help so far!

from ngx-tour.

RetoRechsteiner avatar RetoRechsteiner commented on August 16, 2024

Same Problem here, The anchors are still empty. You found a solution?
We have one abstraction more. An App.Module and a Layout.Module with the Shell.Component. In the Shell.Component we have the router-outlet. But the Tour-Code is still in the App.Component is that right?

from ngx-tour.

isaacplmann avatar isaacplmann commented on August 16, 2024

@RetoRechsteiner
The tour steps being initialized in the app component is fine. It's hard for me to debug your app without seeing code. Can you make a git hub repository that reproduces the issue? Or you can sign up for a (paid) session with me on codementor and I can look directly at your app code.

from ngx-tour.

kulmann avatar kulmann commented on August 16, 2024

My colleague found a solution for this problem: you need to import the tour module (in our case TourNgBootstrapModule) in each and every sub module.

from ngx-tour.

isaacplmann avatar isaacplmann commented on August 16, 2024

I'm glad you found a solution.

from ngx-tour.

sachin-oodles avatar sachin-oodles commented on August 16, 2024

Same Issue .. i have done all the steps provided by @kulmann .. still getting
{name: "start", value: undefined}
{name: "end", value: undefined}
Help me out!!!

from ngx-tour.

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.