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

How can I intercept correctly the next event on each step? #46

Closed empav closed 8 years ago

empav commented 8 years ago

Hi there, how can I intercept correctly the next event on each step? I see there's onStepChange() callback but I can't get how it works. Should I provide an onStepChange function in-scope for each controller involved in the multistep form?

troch commented 8 years ago

onStepChange is on the directive itself, it is an external function you can pass to the directive so it gets called back on each step change. It is not on the scope of the directive or its steps.

empav commented 8 years ago

All right ok. Can you give me a smart way to intercept programmatically "next" and "previous" event on each step?

troch commented 8 years ago

You can try to decorate the nextStep and prevStep methods of multiStepFormInstance.

empav commented 8 years ago

Would you point me to the right direction to do that? Or make me an example...thanks.

troch commented 8 years ago

Would you point me to the right direction to do that?

https://www.google.co.uk/#q=javascript+decorator+pattern

Or make me an example

I hope you are joking...