Angular Template-driven Forms
You can build forms in Angular almost completely inside your HTML templates with Angular's template-driven forms. This course will teach you how to build template-driven forms, create dynamic forms, validate forms data, and save that data to an API.
What you'll learn
Angular has two forms models to choose from: template-driven forms and reactive forms. Template-driven forms are simpler and are a great choice for most use cases. In this course, Angular Template-driven Forms, you'll learn the fundamentals of working with template-driven forms, and also advanced topics for working with complex and dynamic forms. First, you’ll explore the Angular architecture that powers both template-driven forms and reactive forms and the differences between the two paradigms. Next, you’ll discover how to build interactive forms by binding HTML input elements to a data model and how to validate user-entered data. Finally, you'll learn how to do more advanced template forms work, like creating dynamic forms and custom controls. When you’re finished with this course, you’ll have the skills and knowledge of Angular template-driven forms needed to build both simple and complex forms to gather data from the user.
Table of contents
- Adding Template-driven Forms to a Project 1m
- Defining a Data Model 5m
- ngModel: Binding Input Elements to a Data Model 6m
- Populating a Form from API Data 5m
- Behind the Scenes: The Control Value Accessor Directive 3m
- Submitting a Template-driven Form 7m
- Working with ngForm 4m
- Using ngModelGroup to Group Form Values 2m
- Preserving Hidden Data in an ngForm Value 4m
- Using ngForm.submitted and the ngSubmitted Class 5m