I recently utilized angular-archwizard to implement a wizard step with *ngFor
However, I encountered an issue on how to create a dynamic formGroup for each step. In the code below, I managed to create a single formGroup for all steps, but my goal is to have a unique dynamic formGroup for each step.
<aw-wizard #wizard>
<aw-wizard-step *ngFor="let category of categories">
<ng-template awWizardStepTitle>
<span class="custom-title">{{category.categoryLabel}}</span>
</ng-template>
<sof-form [border]="false" [formGroup]="parametersForm">
<sof-sub-form column="2">
<ng-container *ngFor="let parameter of category.parameters | sortBy: 'order'" [ngSwitch]="parameter.type">
<sof-form-label>{{parameter.parameterLabel}}
<span *ngIf="parameter.control | includes: 'required'" style="color: red">*</span>
</sof-form-label>
<sof-form-item style="padding-top: 6px" id="parameters">
<sof-input [type]="'text'" formControlName="{{parameter.parameterId}}" *ngSwitchCase="'text'"></sof-input>
<sof-input [type]="'number'" formControlName="{{parameter.parameterId}}" *ngSwitchCase="'number'"></sof-input>
<sof-monoselect formControlName="{{parameter.parameterId}}" [mode]="'autoComplete'" [options]="parameter.valuesList" bindLabel="label"
bindValue="value" (onSearch)="onSearchParameter($event, parameter)" *ngSwitchCase="'monoselect'"></sof-monoselect>
<label class="switch switch-small" *ngSwitchCase="'toggle'">
<input type="checkbox" name="{{parameter.parameterId}}" formControlName="{{parameter.parameterId}}" (change)="checkboxAction(parameter.parameterId)">
<span class="slider round"></span>
</label>
</sof-form-item>
</ng-container>
</sof-sub-form>
</sof-form>
</aw-wizard-step>
</aw-wizard>