Module 07 of 10

Forms & Validation

Lessons

About This Module

Almost every app needs to collect input from users, and input needs checking before it is trusted. Angular ships with a forms library in @angular/forms that tracks values, validity, and user interaction for you, with two approaches to choose from: template-driven and reactive forms.

It starts with template-driven forms, which rely on ngModel and directives in the template, and reactive forms, which define the form in your component class with FormControl, FormGroup, and FormBuilder. From there it covers validation: the built-in Validators, custom validator functions, and showing error messages based on control state such as touched and invalid.

Some of these videos were recorded for earlier Angular versions, so they may show FormsModule and ReactiveFormsModule imported through NgModules where newer code imports them directly into standalone components. The ideas behind forms and validation are the same. Watch the lessons in order, then continue on to HTTP, Observables & RxJS.

Lessons

4 videos
01

Different Ways to Create Forms in Angular

Compares ways to build forms in Angular: plain template references, template-driven forms, reactive forms, and FormBuilder, and how template-driven and reactive approaches differ.

02

Angular Forms Complete Guide: Reactive & Template-Driven Forms

A broad guide to both form types, covering validations and dynamic forms.

03

Angular Forms Validation

Shows how to validate input in both reactive forms and template-driven forms.

04

Angular Form Validation Tutorial

Form validation with reactive forms, including custom validators and regex pattern validation.