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

Dynamically appending steps on form element click #55

Closed seriousjelly closed 8 years ago

seriousjelly commented 8 years ago

Hi, So I am having a little difficulty here, what I have is a multi step form that contains questions with multiple 'GoTo's' attached to them. What I am hoping to achieve is that when a user clicks on a button that has goto's set to append the relevent steps to the $scope.sections array (which is the scope var that builds the steps).

Is this possible, if not is there any work around that might help?

<multi-step-container steps="sections" on-finish="finish($getActiveStep())" initial-step="step" search-id="'step'">
        <step-container></step-container>
<multi-step-container>

I thought that I could just push to the array, but that doesn't seem to work:

Section.generateStepFromSection(dependentSection).then(function(response) {
    $scope.sections.push(response);
});
rdzidziguri commented 8 years ago

see docs and examples please. there is methods u can directly call and tell component to which step to go. steps need to be initialized from the begging and that's by design. so u can have logic and conditionally set active step but steps list needs to be provided from the beggining.