Closed valexiev closed 8 years ago
Hi @valexiev,
Thanks for creating this PR. I think this is a good feature to have. Could you change the naming of some of your variables:
this.setActiveIndex = function (step, isBackStep)
: change isBackStep
to pushToHistory
- this.setActiveIndex = function (step, isBackStep) {
+ this.setActiveIndex = function (step, pushToHistory = true) {
- this.setActiveIndex = if (!isBackStep && this.activeIndex) {
+ this.setActiveIndex = if (pushToHistory && this.activeIndex) {
this.backStep
to this.lastVisitedStep
- this.backStep = function () {
+ this.lastVisitedStep = function () {
- this.setActiveIndex(this.history.pop(), true);
+ this.setActiveIndex(this.history.pop(), false);
The next question I would ask is: what about going forward in history? (currently it wouldn't be possible because of the use of pop
)
Hi, can you merge and after change the naming @troch ? I would like use this feature quickly 😄
The PR is incomplete, so I'm not going to merge it. It only deals with going back in history and not going forward.
History can be used by using a searchId
: https://github.com/troch/angular-multi-step-form/blob/master/docs/multi-step-container.md.
There are case when you want to jump over some steps. Then if want to go back, you would expect to go to the previous step in history, not the previous index.