Комментарии:
Submit is not a directive, it's an event
ОтветитьThis is good example, but If we have another nested loop with form array. how we can handle with validation, please let us knows. I have pasted json. {"employee": [{"name": "abc","records": [{ "department": "software","salary": "12000"},{"department": "UI","salary": "15000"}]}]}
ОтветитьNeither
let brand of productsForm['controls'].brands['controls']
Nor
let brand of productsForm.controls.brands.controls
are working.. Can somebody help?
nested form is a form inside a form u have add form fields dynamically
ОтветитьYou heelped me lol!!.Thank you so much dude!
ОтветитьBravo wonderful
Ответитьgreat tutorial, excelent job.
ОтветитьThis was really helpful. Thanks a lot. 👍
ОтветитьSir how to validate nested form
Ответитьhow can i add new Form control inside nested group? I can use addControl for main formGroup but i dont have addControl method for nested group????????
ОтветитьThank you so much this really help me alot.
ОтветитьThis is NOT a nested form. This is a simple form array. A nested form is where the nested form is in a different component.
ОтветитьYou are a genius man, you dont realize how much do you help me with this video. A huge hug from Argentina (seriusly, you save me a several hours of study and work )
ОтветитьIf the user makes change to the input box in the second row and wants to revert changes for that row, How to figure out the previous (initial) value of the input box of that row?
ОтветитьNicely done. This is helpful. A few things I would say are first that I try not to use FormBuilder. I think building the form using "new" and FormControl, FormGroup and FormArray is a better approach. Second, I am not sure that iterating over a FormArray in the html is really the same as a "nested" reactive form. Am I right that in the end you still have ONE form? You do not have forms within forms. Perhaps I am over-thinking it.
ОтветитьThanks for this tutorial!
One thing I would like to mention, following your example, i get error: "ERROR in src/app/app.component.html(8,21): : Property 'controls' does not exist on type 'AbstractControl'."
Here is the fix: "let brand of productsForm['controls'].brands['controls']" instead of "let brand of productsForm.controls.brands.controls;"
I use this but give error " value of null" so if possible please solve it
ОтветитьThankyou Very Much Brother ,it helped me alot God bless U
Ответитьhi nice explanation and can you explain lazy loading
Ответить