See my plnkr: http://plnkr.co/edit/OSMtkjWGsDUz1wENtRDR?p=preview
I've got 3 components:
1) App: The base form. This holds references to "mini forms" i.e. subcontrols in the code
2) AppChild: These represent a single "mini form"
3) AppOption: These are a single input control in AppChild
You can click "Add Control" to add a new AppChild, and click "Click to add a new option +" to add an AppOption to an AppChild.
As you can see on my plnkr - each individual mini form (Sub control) has the correct form value printed out.
And the base form - can recognise the correct # of mini forms.
But how do I get it so the mini form values are contained in the base form values - instead of an empty array []?
I've added a comment on the plunkr where I think the issue is but I'm not sure if this is the reason/or how to fix it Line 49
initControl() {
return this.fb.array([]);
}