Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(typings): correctly unpack values of nested form group arrays #180

Merged
merged 1 commit into from Aug 11, 2023

Conversation

ntziolis
Copy link
Contributor

@ntziolis ntziolis commented Aug 11, 2023

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

Minor fix for existing tying of ValuesOf for nested FormArray<FormGroup>.

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

Assuming the following FormType:

export interface FormType {
  items: {
    tags: FormControl<string[]>
  }[]
}

When using ValuesOf<ControlsOf<FormType>> the tags has the type FormControl<string[]> instead of string[].

Issue Number: N/A

What is the new behavior?

The typing now correctly unpacks the values of FormGroup nested in FormArrays.

Does this PR introduce a breaking change?

[x] Yes
[ ] No

Users might encounter a breaking change if they have the above scenario AND rely on the current incorrect typing. Fixing resulting errors is likely low effort

Other information

@stackblitz
Copy link

stackblitz bot commented Aug 11, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@ntziolis ntziolis marked this pull request as ready for review August 11, 2023 09:39
@NetanelBasal NetanelBasal merged commit b774fe8 into ngneat:master Aug 11, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants