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

Dynamic Add Step #53

Closed ricardoborges closed 8 years ago

ricardoborges commented 8 years ago

Is it possible to add new steps on the fly? thanks

rdzidziguri commented 8 years ago

What do u mean adding it on the fly?

the way u can achieve this is to implement next step and decide what next step is going to be. u need to load all steps as this is very simple operation just an array of steps and steps are simple objects u can extend them in any way u want

example of step

{
    "title": "Step title here",
    "caption": "caption which is shown on wizard",
    "tag": [ "TAG1", "TAG2" ],
    "order": 8,
    "isolatedScope": true,
    "controller": "yourCtrlName",
    "controllerAs": "vm",
    "templateUrl": "/path/to/your/template",
    "hasForm": true
  }
troch commented 8 years ago

You can push steps to the steps array you pass to the directive. However this is not recommended because the library tracks the active step by index.

"hat you can do is have all your steps in your steps array, and then decide which ones are visible to the user.

troch commented 8 years ago

I've released version 1.3.0 which adds support for a custom controller at the main directive level. That should help for this kind of stuff.

ricardoborges commented 8 years ago

Roger that! Thank you guys, I'll test the ideas you gave me