[CST-3782] patch add entire array on item remove

This commit is contained in:
Alessandro Martelli
2021-03-31 14:20:44 +02:00
parent f9e80ea288
commit 08afa4723b
2 changed files with 9 additions and 1 deletions

View File

@@ -303,9 +303,10 @@ export class FormComponent implements OnDestroy, OnInit {
removeItem($event, arrayContext: DynamicFormArrayModel, index: number): void {
const formArrayControl = this.formGroup.get(this.formBuilderService.getPath(arrayContext)) as FormArray;
this.removeArrayItem.emit(this.getEvent($event, arrayContext, index, 'remove'));
const event = this.getEvent($event, arrayContext, index, 'remove');
this.formBuilderService.removeFormArrayGroup(index, formArrayControl, arrayContext);
this.formService.changeForm(this.formId, this.formModel);
this.removeArrayItem.emit(event);
}
insertItem($event, arrayContext: DynamicFormArrayModel, index: number): void {