Angular 22 · Routing and forms

Build a reactive form

Define a form group with validators. Import ReactiveFormsModule.

form = new FormGroup({
  email: new FormControl('', [Validators.required, Validators.email]),
  password: new FormControl('', [Validators.required, Validators.minLength(8)]),
});

Official Angular 22 documentation

More routing and forms commands

All routing and forms commands · Angular 22 cheatsheet

Was this page helpful?