Git Product home page Git Product logo

Comments (9)

isaacplmann avatar isaacplmann commented on September 20, 2024

If they are all routes in the same Angular app, you can use the route property on the step configuration. If they're not in the same SPA, you probably want a different tour solution that runs outside of Angular.

from ngx-tour.

aditi-singh avatar aditi-singh commented on September 20, 2024

I did begin with using the route property. It successfully navigates the router to the required URL but I can't get the "tour" to be shown there.

As quoted in the documentation :

The route to which the tour should navigate before attempting to show this tour step. If undefined, no navigation is attempted.

The route is navigated to another page but the tour is shown on the earlier page itself.
I don't seem to understand what I'm doing wrong.

from ngx-tour.

isaacplmann avatar isaacplmann commented on September 20, 2024

I'm not sure - can you share some of your code? It could very well be a bug.

from ngx-tour.

aditi-singh avatar aditi-singh commented on September 20, 2024

This is a snippet from the component I am beginning the tour from. When clicked "next" on angular.ui.tour, the router is navigated to the otherComponent and the installation anchor is formed on this component.

bootstrapTour() {
        this.tourService.initialize([{
            stepId: 'start.tour',
            anchorId: 'start.tour',
            content: 'Welcome to the Ng2-Tour tour!',
            placement: 'below',
            title: 'Welcome',
        }, {
            stepId: 'angular.ui.tour',
            anchorId: 'angular.ui.tour',
            content: 'angular-ui-tour',
            title: 'angular.ui.tour',
        }, {
            anchorId: 'installation',
            route: 'workspace/anotherComponent',
            content: 'First, install the library...',
            title: 'Installation',
        }]);
        this.tourService.start();
    }

This is how the template looks for the above component

<section class="page-header">
    <h1 class="project-name">Ng2 Tour</h1>
    <a style="cursor: pointer" (click)="tourService.toggle()" class="btn btn-primary" tourAnchor="start.tour">Anchor 1</a>
</section>
<section class="page-header">
    <h1 class="project-name">Ng2 Tour</h1>
    <a style="cursor: pointer" class="btn btn-primary" tourAnchor="angular.ui.tour">Anchor 2</a>
</section>
</section>
<section class="page-header">
    <h1 class="project-name">Ng2 Tour</h1>
    <a style="cursor: pointer" class="btn btn-primary" tourAnchor="installation">Anchor 3</a>
</section>

I am not sure how to connect TourService tn the other component. It has a similar component and template as of now.

In the first snippet, when I keep the route as the current component's URL as,

...
 {
            anchorId: 'installation',
            route: 'workspace/thisComponent',
            content: 'First, install the library...',
            title: 'Installation',
}
...

The third section displays the anchor, which is why I said that the tour step is shown on the previous page itself.

from ngx-tour.

isaacplmann avatar isaacplmann commented on September 20, 2024

On the workspace/anotherComponent route, you need to have a tag with tourAnchor="installation" on it. Can you show me the template for that component?

from ngx-tour.

aditi-singh avatar aditi-singh commented on September 20, 2024

workspace/thisComponent : Component where I begin the tour
workspace/anotherComponent : The next component where I would like to take the user on the press of next button.

The above snippets happen to be from thisComponent itslef. Thus, yes, there does exist a tag with tourAnchor="installation" in that component. I'm sorry, the above was a typographic error. I have corrected it now.

from ngx-tour.

isaacplmann avatar isaacplmann commented on September 20, 2024

This piece of html

<section class="page-header">
    <h1 class="project-name">Ng2 Tour</h1>
    <a style="cursor: pointer" class="btn btn-primary" tourAnchor="installation">Anchor 3</a>
</section>

Needs to be in workspace/anotherComponent, not workspace/thisComponent. The third step that you defined is telling the tour library to navigate to the workspace/anotherComponent route and then look for a tourAnchor="installation" directive.

from ngx-tour.

aditi-singh avatar aditi-singh commented on September 20, 2024

That worked!
I had tourAnchor="installation" directive in both workspace/thisComponent as well as workspace/anotherComponent, perhaps which is why there was a conflict.

Thank you very much for your time

from ngx-tour.

isaacplmann avatar isaacplmann commented on September 20, 2024

Glad to help.

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.