Template driven form, how to patch value of a FormGroup

79 views
Skip to first unread message

Christophe HOARAU

unread,
Sep 25, 2016, 2:12:41 AM9/25/16
to AngularJS
Hi,

Let's say I have a FormArray (let call it A) of FormGroups(B) which contains a FormArray(C) of FormGroups(D) ^^.
And I have as input an array of values corresponding exactly to the Template definition.

Is there any way to use patchValue function in this case ? Because of the recursion of the array, when I try to apply patchValue on B element, I have "There are no form controls registered with this array yet" , which correspond on array C contents not being initialized which is logic as it's empty.

My question is, is it possible to define some kind of template to the array definition so it could be automatically used to create it's content ?

Thanks a lot.
Reply all
Reply to author
Forward
0 new messages