Angular Reactive forms

From bibbleWiki
Revision as of 02:12, 7 September 2020 by Iwiseman (talk | contribs) (Created page with "=Angular Forms= Angular provides two types of forms * Template Driven **Easy to use **Familar to Angular JS **Two-way data binding-> minimal component code **Automatically tra...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Angular Forms

Angular provides two types of forms

  • Template Driven
    • Easy to use
    • Familar to Angular JS
    • Two-way data binding-> minimal component code
    • Automatically tracks from and input element state
  • Reactive (model driven
    • More flexible
    • Immutable data model
    • Easier to perform an action on value change
    • Access Reactive transformations such as DebounceTime or DistinctUntilChanged
    • Easily add input elements dynamically
    • Easier unit testing

Template driven forms put the responsibility in the template using basic HTML and data binding, Reactive forms move most of the responsibility to the component class.