Skip to content
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

adding caller controller function in tour-step-content #149

Open
anupbelambe opened this issue Sep 4, 2017 · 3 comments
Open

adding caller controller function in tour-step-content #149

anupbelambe opened this issue Sep 4, 2017 · 3 comments
Milestone

Comments

@anupbelambe
Copy link

anupbelambe commented Sep 4, 2017

I am using the exact versions of the following:

  • Browser: [Chome|Firefox|IE|Safari] Version: 59.3071.1634.2
  • AngularJS: 1.5.5
  • Angular Bootstrap: x.x.x
  • Angular UI Tour: 0.8.2

I have installed this library via: (NPM, Bower, or downloaded package)
NPM

I have observed the following behavior:
While trying to set action button with action being controller function in tour-step-content, the controller action is not getting executed.

This is how I expected it to behave:
The controller function is called if any action is provided in the content.

Here is my tour config, and all related step configs:

<div layout="row" flex ui-tour="abc" ui-tour-placement="bottom-left">

<div layout="row" tour-step="profile" tour-step-title="Title text!" tour-step-content="Now you can edit !<md-button ng-click="controller.funcA()">click for details</md-button>" tour-step-placement="top-left" tour-step-order="0">

Additional notes/code:
In above case the step is shown correctly as expected but not able to get the controller function executed. This might be due to different scopes but is there any way to register callback which can be used in the step-content as additional action. Appreciate any workaround for the same.

@benmarch
Copy link
Owner

benmarch commented Sep 9, 2017

Hey @anupbelambe, do you want to call a method on your controller (i.e., the one controlling your step target) or the tour controller?

@anupbelambe
Copy link
Author

@benmarch, want to call a method on controller (the one controlling your step target)

@benmarch
Copy link
Owner

Interesting, it looks like we lose reference to the enclosing scope once the popover is created so that won't work. I will look into adding that functionality in the next release.

You might be able to achieve this functionality by creating a custom template for this step though.

@benmarch benmarch added this to the 1.0.0 milestone Sep 19, 2017
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