fix(dynamic-forms): dynamically add, edit, remove Form Controls#787
Merged
Conversation
At runtime, have the ability to dynamically add, edit, remove Form Controls closes #624
…al update manual updates are great since checking if an array or its content has changes can be expensive in the long run, and most of the time not needed.. adding a refresh method gives the power to the developer to rerender the form if needed.
Contributor
|
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Per issue #624 reported, the
td-dynamic-formscomponent did not allow having it'selementsarray changes after view rendered.The issue is caused by manually building Form Controls structure provided based
elementsconfig array, causing race conditions and reference errors as theelementsarray is changed after view render.The fix is to use the
FormArrayAPI to add, edit, and remove Form Controls after View Render. As theelementsconfig array changes during runtime, theFormArrayadds, removes, and changes Form Controls as needed.There are no breaking changes.
What's included?
At test branch with a form to add, remove, edit Form Controls is provided.
Research:
Test Steps
git checkout feature/624-dynamic-formsng lintnpm testorng testng servebuild your own formdemoGeneral Tests for Every PR
ng serve --aotstill works.npm run lintpasses.npm testpasses and code coverage is not lower.npm run buildstill works.Screenshots
closes #624