I am looping through the controls for my Angular form. However, the controls are coming from the server, and every form will be different. However, I want to add a submit button to the last control/material stepper. How would I do this?
<ng-container *ngFor="let control of formControls; let i = index">
<div class="row">
<div class="col">
<mat-step *ngIf="['text', 'number'].includes(control.type)" [label]="control.name" class="mb-3">
<mat-form-field class="mt-3">
<input matInput [formControlName]="control.name" [placeholder]="control.name" [type]="control.type" class="mt-3">
</mat-form-field>
<div>
<button mat-button matStepperPrevious uiKitButton="secondary" class="mr-1" type="button">Back</button>
<button mat-button matStepperNext uiKitButton="primary" type="button">Next</button>
</div>
</mat-step>
<mat-step *ngIf="['select'].includes(control.type)" [label]="control.name">
<mat-form-field class="mt-3">
<mat-select [formControlName]="control.name" [placeholder]="control.name">
<mat-option *ngFor="let option of control.options" [value]="option.name">{{ option.name }}
</mat-option>
</mat-select>
</mat-form-field>
<div>
<button mat-button matStepperPrevious uiKitButton="secondary" class="mr-1" type="button">Back</button>
<button mat-button matStepperNext uiKitButton="primary" type="button">Next</button>
</div>
</mat-step>