Comments (5)
Check to see if $scope.tour is available, if your controller is declared outside of the tour declaration then it will not be available. In the initTour function wrap everything with if ($scope.tour) { ... }
.
If that isn't the issue, try using tour.restart(true)
or maybe even tour.start(true)
to force it to start.
from angular-bootstrap-tour.
Any update @vvillasoto?
from angular-bootstrap-tour.
@benmarch I am able to make it work but not by using $scope.tour. This will not be found. I inspected it and found that the tour object is attached to any one of the step elements / or just the container element wherein all the steps can be found within the html. I used angular.element to access it from the controller.
$scope.initTour = function() {
// if you like to do any modification in the tour object
angular.element( "#section1" ).scope().tour._options.template =
"<div class='popover tour-xdkTour' role='tooltip'>" + "\n"
+ "<div class='arrow'></div>" + "\n" + "<h3 class='popover-title'></h3>" + "\n"
+ "<div class='popover-content'></div>" + "\n" + "<div class='popover-navigation'>" + "\n"
+ "<div class='btn-group'>" + "\n"
+ "<button class='btn btn-default' data-role='prev'>« Prev</button>" + "\n"
+ "<button class='btn btn-default' data-role='next'>Next »</button>" + "\n" + "</div>"
+ "\n" + "<button class='btn btn-default' data-role='end'>Next Widget</button>" + "\n"
+ "</div>" + "\n" + "</div>";
// next you can init and start the tour
angular.element( "#section1" ).scope().tour.init();
angular.element( "#section1" ).scope().tour.start();
}
$scope.init = function() {
MyService.getData().then(
function(data) {
$scope.data = data;
$timeout($scope.initTour(), 2000);
}
}
var interval = $interval($scope.init, 60000);
$scope.$on('$destroy', function() {
$interval.cancel(interval);
});
hope this helps. Let me know if you figure out a better solution.
Thanks.
from angular-bootstrap-tour.
It looks to me like this code is in a controller that is outside of the scope of the tour controller. If you can move this controller code inside of "#section1" then you would be able to access it via $scope.tour
. You can also improve this by moving the template text into a template script tag and using the template-url attribute on the tour element.
from angular-bootstrap-tour.
Thanks for the advice. Will try to improve on it. I think this is resolved :)
from angular-bootstrap-tour.
Related Issues (20)
- onStart and onEnd not working? HOT 5
- grunt error HOT 8
- Orphan mode does'nt work... HOT 2
- Is this project maintained? HOT 1
- How can I add more than one step to a same element? HOT 1
- More than one step to a same element HOT 1
- Angular Bootstrap tour 'end tour' when clicked stops the tour for good HOT 9
- template-url option not working HOT 9
- Not supporting the element attribute? HOT 1
- template-url is not working HOT 3
- apply tour-step to ng-repeat HOT 1
- Center placement for element step HOT 1
- Option to lock controls HOT 1
- How to handle steps that are not rendered on tour start? HOT 5
- I want to change the prev and next to icons how can i change them to icons?? HOT 3
- starting tour from controller through ng-click is not working HOT 5
- Cannot read property 'extend' of undefined HOT 1
- Multiple page tour using bootstrap tour HOT 7
- How to use angular-bootstrap-tour with angular 4 and Typescript HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-bootstrap-tour.