We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 15ff078 + d3e9265 commit 0226ccbCopy full SHA for 0226ccb
src/app/shared/form/builder/form-builder.service.ts
@@ -653,9 +653,9 @@ export class FormBuilderService extends DynamicFormService {
653
const newGroup = this.createFormGroup(groupModel.group, null, groupModel);
654
const previousKey = Object.keys(previousGroup.getRawValue())[0];
655
const newKey = Object.keys(newGroup.getRawValue())[0];
656
-
657
- if (!isObjectEmpty(previousGroup.getRawValue()[previousKey])) {
658
- newGroup.get(newKey).setValue(previousGroup.getRawValue()[previousKey]);
+ const rawValue = previousGroup.getRawValue()[previousKey];
+ if (!isObjectEmpty(rawValue)) {
+ newGroup.get(newKey).patchValue(rawValue);
659
}
660
661
formArray.insert(index, newGroup);
0 commit comments