From b58e9830c6a9461a5714314ca4130797f78c0d93 Mon Sep 17 00:00:00 2001 From: Maxime Robert Date: Thu, 19 Dec 2019 12:04:36 +0000 Subject: [PATCH] fix(lib): remap and root form components don't have the default values passed (only a type issue) BREAKING CHANGE: Adding a parameter to the `transformToFormGroup` method could be a breaking change if you're calling `super.transformToFormGroup`. As this method is a callback for ngx-sub-form, chances are: You're not calling it and this change will probably **NOT** affect you. The upgrade should go smoothly. If it does affect you, it'll be caught at build time so it should be easy to find out. --- projects/ngx-sub-form/src/lib/ngx-root-form.component.ts | 5 ++++- projects/ngx-sub-form/src/lib/ngx-sub-form.component.ts | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/projects/ngx-sub-form/src/lib/ngx-root-form.component.ts b/projects/ngx-sub-form/src/lib/ngx-root-form.component.ts index f0ac92cc..9fd7a70d 100644 --- a/projects/ngx-sub-form/src/lib/ngx-root-form.component.ts +++ b/projects/ngx-sub-form/src/lib/ngx-root-form.component.ts @@ -81,7 +81,10 @@ export abstract class NgxRootFormComponent | null, + ): FormInterface | null { return (obj as unknown) as FormInterface; } diff --git a/projects/ngx-sub-form/src/lib/ngx-sub-form.component.ts b/projects/ngx-sub-form/src/lib/ngx-sub-form.component.ts index 1c040e6c..59855219 100644 --- a/projects/ngx-sub-form/src/lib/ngx-sub-form.component.ts +++ b/projects/ngx-sub-form/src/lib/ngx-sub-form.component.ts @@ -423,6 +423,9 @@ export abstract class NgxSubFormRemapComponent ControlInterface, FormInterface > { - protected abstract transformToFormGroup(obj: ControlInterface | null): FormInterface | null; + protected abstract transformToFormGroup( + obj: ControlInterface | null, + defaultValues: Partial | null, + ): FormInterface | null; protected abstract transformFromFormGroup(formValue: FormInterface): ControlInterface | null; }