From 789ff49bcf958a5e2d44fceb1f8f9bde6d86db3e Mon Sep 17 00:00:00 2001 From: Brandon Roberts Date: Mon, 24 Sep 2018 15:24:17 -0500 Subject: [PATCH] docs: update with forms overview review feedback (#25663) PR Close #25663 --- aio/content/guide/forms-overview.md | 157 ++++++++++++++++++---------- 1 file changed, 101 insertions(+), 56 deletions(-) diff --git a/aio/content/guide/forms-overview.md b/aio/content/guide/forms-overview.md index 7b99d3b6d0..e1e2dd87fa 100644 --- a/aio/content/guide/forms-overview.md +++ b/aio/content/guide/forms-overview.md @@ -1,17 +1,27 @@ # Introduction to forms in Angular -Handling user input with forms is the cornerstone of many common applications. Applications use forms to log in, to update a profile, to enter sensitive information, and to perform many other data-entry tasks. +Handling user input with forms is the cornerstone of many common applications. Applications use forms to enable users log in, to update a profile, to enter sensitive information, and to perform many other data-entry tasks. -Angular provides two different approaches to handling user input through forms: reactive and template-driven. Both capture user input events from the view, validate the user input, create a form model and data model to update, and provide a way to track changes. Each approach uses a distinct way of processing forms and offers different advantages. There are many different factors such as how data flows from the view to the data model and data model to the view, predictability of access to the form model, validation and testing, mutability, and scalability that influence your decision on which approach works best for your situation. The sections below provide a description of the common building blocks with each approach and a comparison of those key factors. +Angular provides two different approaches to handling user input through forms: reactive and template-driven. Both capture user input events from the view, validate the user input, create a form model and data model to update, and provide a way to track changes. + +Reactive and template-driven forms differ, however, in how they do the work of processing and managing forms and form data. Each offers different advantages. **In general:** * **Reactive forms** are more robust: they are more scalable, reusable, and testable. If forms are a key part of your application, or you're already using reactive patterns for building your application, use reactive forms. * **Template-driven forms** are useful for adding a simple form to an app, such as an email list signup form. They are easy to add to an app, but they do not scale as well as reactive forms. If you have very basic form requirements and logic that can be managed solely in the template, use template-driven forms. +This guide provides information to help you decide which approach works best for your situation. It introduces the common building blocks used by both approaches. It also summarizes the key differences between the two approaches, and demonstrates those differences in the context of setup, data flow, and testing. + +
+ +*Note:* For complete information about each kind of form, see the [Reactive Forms](guide/reactive-forms) and [Template-driven Forms](guide/forms) guides. + +
+ ## Key differences -The table below summarizes the key differences in reactive and template driven forms. +The table below summarizes the key differences between reactive and template-driven forms.