-
Notifications
You must be signed in to change notification settings - Fork 67
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
Content(forms): Use ControlValueAccessor to create sub-forms #51
Comments
I just add my 2 cents here because I think this is worth a discussion. In general we can distinguish between two ways of implementing sub-forms:
I would use the CVA for control-like components only. It integrates well into the lifecycle of Angular forms in the sense that you can "just use it without further knowledge". "control-like" means parts of the form that are atomic and reusable: date picker, counter control (num field with ± buttons), typeahead search, custom dropdown, slider … all fit into that category for me. Long story short, in my opinion we should use it this way:
Happy to hear your opinion about this! // cc @dhhyi |
@billyjov Thanks for proposing this one. I very much agree with what has been said by @fmalcher. That said, we should definitely have an item for @billyjov @fmalcher Would either of you like to work on such item? Would be great to have this part of the checklist. |
@fmalcher i agree with what you are saying. I would even name a third method using dependency injection and viewProviders. IMO i think it would be good to show in a checkpoint that there are exactly these ways and to mention that each technique is better suited for certain use case and probably be an overhead for another cases. But we should not forget that there are other libraries that deal with the topic of forms (e.g Strong typing not provided by Angular Forms out-of-the-box). How can we deal with it or would such libraries be possible recommendations for some use cases ? @d3lm BTW sure i would like to contribute to this item, but will probably need some input from you experienced |
Ok cool. What input do you need from me? In general, for items we should aim to keep them as short as possible. Items are not supposed to be blog posts and only demonstrate a problem and show the solution. So maybe we can have two items, or potentially 3, that explain individually when to use CVA or child components in general. These items can of course link to one another. For example one item for
and another one for
What do you guys think? |
What about add this item? May sound irrelevant for small forms, but in my opinion important for huge forms
The text was updated successfully, but these errors were encountered: