Nested Forms in Angular

Nested Forms in Angular - Part 2

Published on – 700 Words

After publishing my original Nested Forms in Angular article, my friend and colleague Val Neekman suggested I add a fourth approach, where static factory methods on each of the child components are used instead of a separate factory service. So it is with my thanks to him for the idea, along with some sample code to look at and a much appreciated review of my implementation of the idea, that I am able to write up Part 2 in my Nested Forms in Angular series.

Nested Forms in Angular

Published on – 1600 Words

The official Angular documentation discussing Reactive Forms shows how one can use groups and arrays to organize a form, and to dynamically add to it. The drawback of the example on that page is that everything is in a single component.

Once a component starts to grow in size and complexity, it becomes desirable to decompose it into multiple smaller components. At this point, there are a number of ways to break up the form into a set of nested form elements.