-
Notifications
You must be signed in to change notification settings - Fork 26.2k
fix(forms): inserting and removing controls should work in re-bound f… #21822
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
Conversation
You can preview 759439e at https://pr21822-759439e.ngbuilds.io/. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…orm arrays (angular#21822) Closes angular#21501 PR Close angular#21822
…orm arrays (angular#21822) Closes angular#21501 PR Close angular#21822
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
…orm arrays
Closes #21501
In brief: there was a problem with calling
FormArray.removeAt()
andFormArray.insert()
after aFormArray
was replaced withsetControl
. The collection changes calls would cause the directives to update too early, which caused form controls to be saved at the wrong offset. So on submit, some controls were not defined. Since the directives correct themselves on removal, the collection changes calls were unnecessary.