FormArray usecase
See original GitHub issueFirst of all, nice work! Really.
I was having a look at your Droids/Vehicles example, and a question emerged.
What do I do if I need to handle a FormArray
?
An example to clarify: what if I want the user to be able to pick multiple colors for a Spaceship? I’ll have to deal with multiple (1...N
) color picker. This is one thing missing from the README.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:13 (2 by maintainers)
Top Results From Across the Web
Angular FormArray - Complete Guide
We are going to give an example of a common use case that would be hard to implement without a FormArray : an...
Read more >Working with Angular FormArray - JScrambler Blog
In this post, we'll teach you how to use the Angular FormArray to add dynamic data into the Angular form and validate it....
Read more >Angular 10 Tutorial #69 - Reactive Forms - FormArray - YouTube
Angular 10 Tutorial formarray, Angular 11 Tutorial, Angular reactive form formarray, form controls tutorial, Reactive form formArray example ...
Read more >Angular: N Level FormArray With Reactive Form Validation
All forms contain N details and distinct fields, as well as dynamic validation when data is entered. Use case image. Prerequisites. Prior ...
Read more >How to use parent radio form control in form array reactive ...
I have a formControl (Radio) in parent formGroup and wanted to use it within formArray . Usecase is MCQ Question is having multiple...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @AdditionAddict,
I’ve just finished to write a blog post about how to manage complex forms and I’m explaining there why passing a
formGroup
as an input is in my opinion not a good idea. I’ll let you go through the article if you want to know more https://dev.to/maxime1992/building-scalable-robust-and-type-safe-forms-with-angular-3nf9About your example, I’ve been trying to build it and yes I’m also stuck with the array.
I planned to get back on that issue a week or two ago but a PR was pending (CF https://github.com/cloudnc/ngx-sub-form/pull/41) and I didn’t want to start a new one until that one was done. I guess it can/will be prioritised now 😃
I’ll come back to you as soon as the work is done with a demo for your example 👍
@AdditionAddict I’ve been working yesterday and this morning onto that feature.
I’ve got a branch here https://github.com/cloudnc/ngx-sub-form/tree/feat/form-array where I’m nearly done but I miss a few tests and a bit of cleanup too.
Can’t have a look at that until tonight but I think it’ll take me until the end of the week to finish that one up so if you can wait I’d recommend you to, otherwise just clone my branch locally and build the library then use it in your own project like that for a few days. I highly doubt the public API will change it’ll be mostly tests and cleanup now. But once again if you can wait a few days it’ll be easier and I also have a repro of your demo just waiting that the branch I’m working on is published 😃