benmarch/angular-ui-tour

StepID

Closed this issue · 1 comments

I'm using stepChanged event. It passes whole next step.
I use it to save current step to server.
But it doesn't have index in it. And I didn't used id in DOM.

It's a suggestion. If id attribute isn't set why not use ui-step-+step.order which is (in general) unique? Now id is the same for every step.
This way You don't have to name id`s of steps.

Or even better pass index to current step.

PS. Now I discovered that id attribute is not setting stepId only tour-step="<stepId>"
There is no good docs for this:/

I will add the documentation about the tour-step attribute and the step id.

The indexes are generally intended to be used internally for tracking purposes, it would be best to supply your own IDs to each step (in the tour-step attribute) and save them on your end. That will also allow you to save semantic IDs instead of ordered IDs which can potentially change as you add steps. You will be able to pass the IDs back into the tour.startAt(id) method to resume when your users return.