Outline
- Intro to Reactive Forms in Angular - Course Introduction
- Intro to Reactive Forms in Angular - FormControl Foundations
- Intro to Reactive Forms in Angular - Building a Form with Groups
- Intro to Reactive Forms in Angular - Simplify Form Creation
-
Intro to Reactive Forms in Angular - Make Forms Dynamic
- Introduction
- Demo: FormArray with FormControls in the Component
- Exercise: Fix the Errors! FormArray with FormControls
- Solution: Fix the Errors! FormArray with FormControls
- Demo: FormArray with FormControls in the Template
- Exercise: FormArray with FormControls
- Solution: FormArray with FormControls
- Demo: Removing Items from a FormArray
- Demo: FormArray with FormGroups
- Exercise: FormArray with FormGroups
- Solution: FormArray with FormGroups
- Wrap Up
-
Intro to Reactive Forms in Angular - Validate Forms
- Introduction
- Demo: Built-in Validators
- Exercise: Built-in Validators
- Solution: Built-in Validators
- Demo: Adding Error Messages
- Exercise: Adding Error Messages
- Solution: Adding Error Messages
- Styling Controls for Validity
- Update Validators Dynamically
- Demo: Custom Validators
- Exercise: Custom Validators
- Solution: Custom Validators
- Demo: Cross-field Validation
- Exercise: Cross-field Validation
- Solution: Cross-field Validation
- Wrap Up
- Intro to Reactive Forms in Angular - Course Wrap Up
-
Let's Code Together - Building a Search Form
- Introduction
- Code Walkthrough and First Assignment
- Add ReactiveForms Module
- Create Initial Form
- Call Search Method
- Name Searching
- Using Select with Reactive Forms
- Implement League Search
- Implement Game Night Search
- Implement Recruiting Search
- Implement Coed Search
- Implement Max Search Fee
- Implement Record Search & Summary
-
Lets Code Together - Building an Edit Form with Reactive Forms
- Introduction
- Demo Code Walkthrough
- First Assignment
- Create the Basic Form
- Hook Up Form Events
- Show & Hide the Form
- Set the Name on Edit
- Save Changes to Name
- Set and Save GameNights
- Set and Save Max Teams & Coed
- Set seasonStarts & seasonEnds
- Save sasonStarts & seasonEnds
- Set & Save the Contact Emails
- Adding New Contact Emails
- Deleting Contact Emails
- Lets Code Together - Validating an Edit Form with Reactive Forms
Outline
- Intro to Reactive Forms in Angular - Course Introduction
- Intro to Reactive Forms in Angular - FormControl Foundations
- Intro to Reactive Forms in Angular - Building a Form with Groups
- Intro to Reactive Forms in Angular - Simplify Form Creation
-
Intro to Reactive Forms in Angular - Make Forms Dynamic
- Introduction
- Demo: FormArray with FormControls in the Component
- Exercise: Fix the Errors! FormArray with FormControls
- Solution: Fix the Errors! FormArray with FormControls
- Demo: FormArray with FormControls in the Template
- Exercise: FormArray with FormControls
- Solution: FormArray with FormControls
- Demo: Removing Items from a FormArray
- Demo: FormArray with FormGroups
- Exercise: FormArray with FormGroups
- Solution: FormArray with FormGroups
- Wrap Up
-
Intro to Reactive Forms in Angular - Validate Forms
- Introduction
- Demo: Built-in Validators
- Exercise: Built-in Validators
- Solution: Built-in Validators
- Demo: Adding Error Messages
- Exercise: Adding Error Messages
- Solution: Adding Error Messages
- Styling Controls for Validity
- Update Validators Dynamically
- Demo: Custom Validators
- Exercise: Custom Validators
- Solution: Custom Validators
- Demo: Cross-field Validation
- Exercise: Cross-field Validation
- Solution: Cross-field Validation
- Wrap Up
- Intro to Reactive Forms in Angular - Course Wrap Up
-
Let's Code Together - Building a Search Form
- Introduction
- Code Walkthrough and First Assignment
- Add ReactiveForms Module
- Create Initial Form
- Call Search Method
- Name Searching
- Using Select with Reactive Forms
- Implement League Search
- Implement Game Night Search
- Implement Recruiting Search
- Implement Coed Search
- Implement Max Search Fee
- Implement Record Search & Summary
-
Lets Code Together - Building an Edit Form with Reactive Forms
- Introduction
- Demo Code Walkthrough
- First Assignment
- Create the Basic Form
- Hook Up Form Events
- Show & Hide the Form
- Set the Name on Edit
- Save Changes to Name
- Set and Save GameNights
- Set and Save Max Teams & Coed
- Set seasonStarts & seasonEnds
- Save sasonStarts & seasonEnds
- Set & Save the Contact Emails
- Adding New Contact Emails
- Deleting Contact Emails
- Lets Code Together - Validating an Edit Form with Reactive Forms
In this section, we'll cover the last of the three building blocks in @angular/forms, the FormArray. Like FormGroup, FormArray aggregates other controls, however it’s distinct because it allows us to be dynamic with how many child controls it has.
A good use case for a FormArray is when you have an indefinite number of child controls, and you want the flexibility to add or remove as many as needed. For example, let’s say you’re applying for a job and there’s a section that asks you to enter any relevant skills you have as separate fields. They don’t know how many skills you’ll put, so you want flexibility. Before submitting the application, you could add or remove as many skills as you want. A FormArray would allow us to do something like this. It provides a dynamic way to group together controls.
It’s worth noting that Form array aggregates an array of abstract controls, so that includes Form Controls, Form Groups, or even other Form Arrays. We'll start this section using FormArray with FormControls as the simplest case.