Skip to content

Latest commit

 

History

History
46 lines (29 loc) · 913 Bytes

README.md

File metadata and controls

46 lines (29 loc) · 913 Bytes

Angular dynamic Forms

This repository is a base for a course about angular dynamic forms. It is based on the following starter template: https://github.com/abariatti/angular-material-starter

Angular template driven forms

When to use

  • Small forms
  • Simple logic

What to keep in mind

  • Asynchronous
  • Hard to test

Template driven validation

  • Validation is template based through existing validator
  • Add validation programmatically in component with existing validators (https://angular.io/api/forms/Validators)
  • Custom validator possible but more complicated through directive

Angular reactive forms

When to use

  • Bigger forms
  • More logic
  • More structure

What to keep in mind

  • Synchronous
  • Easy to test
  • Structure: FormControl, FormGroup, FormArray

Angular dynamic forms

Step 1

Setup dynamic forms

Step 3

Added custom validation

Step 4

...