Reactive Forms

Two options to build forms in Angular:

  • Template Driven Form

  • Reactive Form

Template Driven Form

  • Its the default option to build forms in Angular

  • It uses Angular provided form template directives to build forms

Reactive Form

  • We create the model objects of the Form elements in the component code, thus these are also known as model-driven forms. There is very minimal form template in the HTML

  • advantages:

    • js object driven form fields and their validations

    • dynamically validate and generate the custom validation messages for the form fields

    • easily unit testable

Read in Details

https://medium.com/aviabird/complete-angular2-guide-reactive-forms-in-depth-part-1-21a8e2428904

Last updated