@klippa/ngx-enhancy-forms 14.12.2 → 14.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@ import { Directive, Input, EventEmitter, Component, SkipSelf, Optional, Output,
3
3
  import * as i1 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
5
  import * as i2 from '@angular/forms';
6
- import { UntypedFormArray, UntypedFormGroup, UntypedFormControl, FormControl, FormArray, FormGroup, NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
6
+ import { UntypedFormArray, UntypedFormGroup, FormControl, UntypedFormControl, FormArray, FormGroup, NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
7
7
  import { isString } from 'lodash-es';
8
8
  import { isArray } from 'lodash';
9
9
  import * as i4 from '@ng-select/ng-select';
@@ -202,13 +202,13 @@ class FormComponent {
202
202
  const injectAt = this.subFormPlaceholder.at;
203
203
  if (injectInto instanceof UntypedFormArray) {
204
204
  const idx = injectInto.controls.findIndex(e => e === this.formGroup);
205
- injectInto.removeAt(idx);
205
+ injectInto.setControl(idx, new FormControl());
206
206
  }
207
207
  else if (injectInto instanceof UntypedFormGroup) {
208
208
  if (typeof injectAt !== 'string') {
209
209
  throw new Error(`cannot index FormGroup with ${typeof injectAt}`);
210
210
  }
211
- injectInto.removeControl(injectAt);
211
+ injectInto.setControl(injectAt, new FormControl());
212
212
  }
213
213
  }
214
214
  }