← Angular learning pathAngular · Module 7 of 10
Forms
Collect and validate input with template-driven and reactive forms.
📖 Key ideas
- Template-driven forms use ngModel in the template (simple forms).
- Reactive forms build FormGroup and FormControl in the class (complex forms).
- Validators: Validators.required, email, minLength(6).
- Check form.valid and show errors when a control is touched.
- Reactive forms are easier to test and scale.
💡 Real-life example: A reactive form is a checklist the class owns; the template just shows the boxes.
FormControlOne input value and status
FormGroupCollection of controls
ValidatorsRules like required or email
touchedUser has visited the field