troch / angular-multi-step-form

An angular module for creating multi step forms / wizards
http://troch.github.io/angular-multi-step-form
ISC License
144 stars 44 forks source link

Get title of next step #33

Closed remib closed 8 years ago

remib commented 8 years ago

This module is really useful, thanks.

I'm just struggling to get the title of the next and previous steps in a similar way as you do for the active step i.e. $getSteps().title

Is there a simple way?

Thanks again

troch commented 8 years ago

https://github.com/troch/angular-multi-step-form/blob/master/docs/multi-step-instance.md

You can use

To do something like this:

const prevTitle = $scope.$isFirst() ? null : $scope.$getSteps()[$scope.$getActiveIndex() - 1].title;
const nextTitle = $scope.$isLast() ? null : $scope.$getSteps()[$scope.$getActiveIndex() + 1].title;
remib commented 8 years ago

Edit: Please ignore, I'm being incredibly stupid. The page is called type. I am an idiot. Thanks a lot!