Angular forms - lordoftheflies/angular-essential-training GitHub Wiki

Web applications are usually doing one of two things, either displaying data or collecting it. The way we collect data through web apps is the use of forms. And more specifically form elements. When we build forms in web apps, we architect them to do a common set of things: for a way to collect data, for a way to know when user changes data, for validating data, and for showing errors to users. Since forms are a common piece of web app development, Angular has dedicated code in it's framework to help when working with forms. We've covered how you can bind data to component template views, and we've covered how you can bind to dominance as well. Angular forms build upon that and provides data binding both in and out. It also provides indicators out of the box for you to know when form fields have changed from their original value, and when they are invalid. Angular forms provides built-in data validators and the ability to create your own even async validators that can run validation as the user changes input value. It also wraps up form fields into an object structure for ease of use on submission. There are two common approaches to building forms in Angular: template driven, where the majority of the form logic is crafted in the template markup, and model driven, where the majority of the form logic is crafted in the component class. Overall, the form support built into Angular covers a wide range of input collection scenarios.