Giter Club home page Giter Club logo

Comments (7)

benmarch avatar benmarch commented on May 27, 2024

Do you mean a url to navigate to when you click the "Next" or "Previous" button? If so, try creating an "onNext" or "onPrev" function that will handle the redirect for you. What is the specific use case?

from angular-bootstrap-tour.

suriyagp avatar suriyagp commented on May 27, 2024

i am developing single page app in which i have load different html template. where can i put those functions inside the directive? or my custom function?? kindly explain with an example

from angular-bootstrap-tour.

benmarch avatar benmarch commented on May 27, 2024

You would put them in a controller...

<div ng-controller="MyController">
    <div id="someTourElement" tour-step on-next="goToPageTwo()"> ... </div>
    ...
</div>

then...

angular.module('MyModule').controller('MyController', function ($scope, $location) {
    $scope.goToPageTwo = function () {
        $location.path('pageTwo');
    };
});

This example assumes you are using Angular routing to load the HTML template, but something along these lines should do the trick!

from angular-bootstrap-tour.

suriyagp avatar suriyagp commented on May 27, 2024

it works but there is some problem, i am having order="0" at /path1 and order="1" same /path1. Then i am having my order="2" on the /path2. at the tour step of order="1" the "next" button is get disabled how to maintain the flow of tour steps between various path.

After switching the path need to maintain the same tour flow

from angular-bootstrap-tour.

benmarch avatar benmarch commented on May 27, 2024

Ah ok that might be a bug, if there is no next element visible it will disable the button. I'll have to see how Bootstrap Tour handles navigation and I will integrate it with this plugin.

from angular-bootstrap-tour.

suriyagp avatar suriyagp commented on May 27, 2024

Ok waiting for that 👍

from angular-bootstrap-tour.

benmarch avatar benmarch commented on May 27, 2024

I have added this functionality to 0.3.0.

To use it you will specify either a nextPath or prevPath (or both) and a nextStep or prevStep. For example:

view1.html:

<div tour-step="step1" title="Step 1 on View 1" next-path="view2" next-step="step2">...</div>

<div tour-step="step3" title="Step 3 on View 1" prev-path="view2" prev-step="step2">...</div>

view2.html:

<div tour-step="step2" title="Step 2 on View 2" next-path="view1" next-step="step3" prev-path="view1" prev-step="step1">...</div>

When you start the tour on page 1, the tour will load up step 1 first. When you click next it will navigate to '/view2' and load up step 2. When you click next on step 2 it will navigate back to view1 and load up step 3. Notice step 2 has a next and prev option so that it will be continuous regardless of the direction you are touring in.

This does not allow for navigation other than Angular routing ATM, but I can build into the next release. Hopefully this will cover your case for now.

The reason we can't use "path" the way that BT uses it is because in BT all the steps are laid out up front and it can determine how to navigate through them. But because we use directives to create the list of steps there is no way for us to know if there is another step on a different page. Using prev and next will create a simple flow control mechanism that can be expanded to same page navigation using step names instead of numeric orders, and multiple page navigation using browser navigation instead of Angular routing.

Take a look at the updated demo to see it in action.

from angular-bootstrap-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.