-
-
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
Pushing FormGroup to a strongly typed FormArray throws a compilation error #50
Comments
Can you try this:
|
That works, but doesn't change anything about the error. |
So what do you mean by saying "works"? |
Doesn't throw error and assigns empty array to FormArray. I assumed that you wanted to check some other similar scenario |
So it's OK now with my solution? |
No. I meant that your solution doesn't throw an error by itself, but the error I described is still there. Sry for confusion |
@danzrou when you can, please check the FormBuilder. |
When providing the generic type on the
Please check in latest version. |
Works with latest package. Thx guys |
I'm submitting a...
Current behavior
Following compilation error appears when pushing to typed FormArray
Expected behavior
Minimal reproduction of the problem with instructions
Consider following example:
this.elementsForm.push(element)
causes described error.I applied following fix:
this.elementsForm.push(element as AbstractControl<Element>)
since push method accepts AbstractControl, but FormGroup extends NgFormGroup which doesn't accept generic types.What is the motivation / use case for changing the behavior?
Environment
The text was updated successfully, but these errors were encountered: