FormGroup is an Angular reactive-forms class that collects named FormControl objects into one manageable form model. It supports collective value, status, validation, and control operations while preserving access to individual controls. The ngForm directive wraps a FormGroup for template-oriented forms, whereas reactive forms use the class directly in a component. section 21.2
Group product controls
Create a group by mapping control names to existing controls: `productForm = new FormGroup({ name: this.nameField, category: this.categoryField });`. The names become the keys used for reading, writing, resetting, and locating controls. In the template, bind the group with `[formGroup]="productForm"`, then connect inputs with `formControlName="name"` and `formControlName="category"`.
Use the group API to manage the form as a unit:
- Subscribe to `statusChanges` to detect group validation status; the group is invalid when any individual control is invalid. section 21.4
Validation can be queried through the group with `getError(validator, path)` and `hasError(validator, path)`, where the path identifies a named control such as `category`. For repeated messages, retrieve the control with `get` and let a directive subscribe to its status changes. section 21.4.3
