The Control Container and I
summary
A multi-step Angular loan form for an Animal Crossing demo runs into "formControlName must be used with a parent form group" when splitting steps across routes and nested components and the fix is to surface the parent form group via ControlContainer either by adding it to child viewProviders with useExisting: FormGroupDirective or by providing it on the parent and injecting the container in children to call controlContainer.control.get('field').valid so navigation disables until validity is satisfied.
AI-written summary · about
chapters (6)
- 0:00Introduction and use case
- 2:52Implementing multi-step forms
- 6:23The problem with nested forms
- 7:50Using ControlContainer
- 10:44Programmatic form control
- 14:12Conclusion and resources
related talks
19mSimplifying deep angular forms with di equipped custom components
35mLet's Build a Form Around It
28mHandling Angular Forms Without Losing Your Sanity
47mAngular Forms
17mIndiana Jones and the Hidden Secrets of the Forms API
48mHandling Angular Forms Without Losing Your Sanity
20mLet’s Build A Form Around It
35mIndiana Jones and the Hidden Secrets of the Forms API
