Skip to content

A tour-step does not put itself on scope #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bartvanderwal opened this issue Jun 23, 2015 · 4 comments
Closed

A tour-step does not put itself on scope #23

bartvanderwal opened this issue Jun 23, 2015 · 4 comments

Comments

@bartvanderwal
Copy link
Contributor

Hi! Great project! Very helpful.

A thing I'm missing is that the tour-step directive doesn't put 'itself' on the scope in the link function. You ARE doing this in the tour directive (see [ln 47]([tour directive]%28https://github.com/benmarch/angular-bootstrap-tour/blob/master/app/tour_directive.js%29)):

    //Initialize tour
    templateReady.then(function () {
        scope.tour = ctrl.init(tour); /// <- this line
        scope.tour.refresh = ctrl.refreshTour;
    });

Could you add a similar thing in the tour_step? (e.g. here on line 94)

    //Add step to tour
    templateReady.then(function () {
        scope.step = step;  // <-- Please add this line here!!
        ctrl.addStep(step);
    });

I understand that this is not needed by your code. But that gives me a hook to extend your directive with another custom directive. I could also clone your project and do a PR if you prefer that! Let me know.

Background:
I'm working an extension. I'm using your directives as much as possible, but extended them with two custom ones so all things like 'title', 'content', et.c can also be set in one single place in a config object. That way we don't have to put them within the HTML directly. That would litter the views in our project with a lot of code. Furthermore the config could then also be retreived and saves in the backend, for instance to allow dynamic customization per user.

Connecting the tour steps to certain places in the DOM/view is still done with your 'tourandtour-step` directives. But only a name needs to be specified to make the connection to the stuff in config.

@bartvanderwal bartvanderwal changed the title Could you have the step directive set itself on scope A tour-step does not put itself on scope Jun 23, 2015
@bartvanderwal bartvanderwal changed the title A tour-step does not put itself on scope A tour-step does not put itself on scope Jun 23, 2015
@bartvanderwal bartvanderwal changed the title A tour-step does not put itself on scope A tour-step does not put itself on scope Jun 23, 2015
@benmarch
Copy link
Owner

Sounds pretty cool, I'd like to check it out when it's done (if it's open sourced). I don't see how it could hurt to add the step to the scope, but I would appreciate a PR since I don't know when I will be able to get to it. It can definitely be in the Angular-UI version.

bartvanderwal added a commit to bartvanderwal/angular-bootstrap-tour that referenced this issue Jul 8, 2015
@bartvanderwal
Copy link
Contributor Author

Hey @benmarch, I did a pull request. Can you see it? :)

Pull and close this issue?

@benmarch
Copy link
Owner

Hey Bart, sorry for the delay, I did see it but I was away on vacation and couldn't review it. I'll take a look now and comment in the PR.

bartvanderwal added a commit to bartvanderwal/angular-bootstrap-tour that referenced this issue Jul 12, 2015
bartvanderwal added a commit to bartvanderwal/angular-bootstrap-tour that referenced this issue Jul 12, 2015
bartvanderwal added a commit to bartvanderwal/angular-bootstrap-tour that referenced this issue Jul 12, 2015
bartvanderwal added a commit to bartvanderwal/angular-bootstrap-tour that referenced this issue Jul 12, 2015
bartvanderwal added a commit to bartvanderwal/angular-bootstrap-tour that referenced this issue Jul 12, 2015
@benmarch
Copy link
Owner

Merged PR #25 and released 0.3.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants