Open jornncc opened 8 years ago
I've seen that error in the past too. I'm actually looking at bringing nz-tour into the framework agnostic world right now, as I recently started using Jumpsuit (react/redux) instead of angular. I'm not sure how quick I can get this fixed, so if you or anyone out there wants to spearhead this, my appreciation would go far.
Great. In-App-Tour is a POC for us at the moment, but if I get product management onboard with this project and decide to fold this into the app as a proper feature then I can help out with adding a few methods to the service api.
The nzTour service has a current
parameter that's used internally. It's set to false
by default (and when the tour stops or finishes) and is set to an object while the tour is active (on start).
So maybe you could use the truthiness of current
in the meantime? This plunker prints out current
before and after start
.
Would be nice to have a more public API for this, maybe harden some of the code? Keeping this issue open as an enhancement request.
For posterity:
$scope.start = function() {
console.log(nzTour.current, !!nzTour.current); // false
nzTour.start(tour);
console.log(nzTour.current, !!nzTour.current); // true
};
The api doesn't explain how I should check if a tour is currently active. Trying to advance the tour automatically when the user interacts with the ui (via nzTour.gotoStep()) but if the tour is currently not active, then we get this error: