-
-
Notifications
You must be signed in to change notification settings - Fork 56
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
fb.array doesn't transfer the generic type Control to the FormArray construction #137
Comments
I'm not sure I follow. |
Sorry I encoded it a bit fast. Below are some details First, you can find an example here: https://stackblitz.com/edit/angular-ivy-ktpmpb The issue is that when we specify a array<T, Control extends AbstractControl = T extends Record<any, any> ? FormGroup<ControlsOf<T>> : FormControl<T>>(controlsConfig: Control[], validatorOrOpts?: ConstructorParameters<typeof FormArray>[1], asyncValidator?: ConstructorParameters<typeof FormArray>[2]): FormArray<T, T extends Record<any, any> ? FormGroup<ControlsOf<T>> : FormControl<T>>; In my use case, I decided to specify a To fix this, I think we should put the
|
Can you please try it locally in the repo playground/spec? |
Issue related:
here is an example based on the previous comment: https://stackblitz.com/edit/angular-ivy-w1eyiv?file=src%2Fapp%2Fapp.component.ts So to solve my previous issue, instead of using a However, the So But it works if I just put |
As requested, same issue in your repo playground: https://github.com/jogelin/reactive-forms/tree/issue-137 |
I mean after your fix :) |
I created a PR with both fixes + some playground improvements to validate my fixes. |
reactive-forms/libs/reactive-forms/src/lib/form-builder.ts
Line 24 in a6a0c22
The text was updated successfully, but these errors were encountered: