Skip to content

Commit

Permalink
Merge pull request #125 from cloudnc/fix/remap-and-root-form-default-…
Browse files Browse the repository at this point in the history
…values

Remap and root form components don't have the default values passed (only a type issue)
  • Loading branch information
maxime1992 authored Dec 19, 2019
2 parents 48dc131 + b58e983 commit 050cd3a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion projects/ngx-sub-form/src/lib/ngx-root-form.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ export abstract class NgxRootFormComponent<ControlInterface, FormInterface = Con
super.writeValue(obj);
}

protected transformToFormGroup(obj: ControlInterface | null): FormInterface | null {
protected transformToFormGroup(
obj: ControlInterface | null,
defaultValues: Partial<FormInterface> | null,
): FormInterface | null {
return (obj as unknown) as FormInterface;
}

Expand Down
5 changes: 4 additions & 1 deletion projects/ngx-sub-form/src/lib/ngx-sub-form.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,9 @@ export abstract class NgxSubFormRemapComponent<ControlInterface, FormInterface>
ControlInterface,
FormInterface
> {
protected abstract transformToFormGroup(obj: ControlInterface | null): FormInterface | null;
protected abstract transformToFormGroup(
obj: ControlInterface | null,
defaultValues: Partial<FormInterface> | null,
): FormInterface | null;
protected abstract transformFromFormGroup(formValue: FormInterface): ControlInterface | null;
}

0 comments on commit 050cd3a

Please sign in to comment.