1 00:00:00,300 --> 00:00:04,260 In this lecture, we were going to start working with template driven forms. 2 00:00:04,560 --> 00:00:07,620 The last section was dedicated to reactive forms. 3 00:00:07,830 --> 00:00:12,390 Previously, we would define form groups and controls in the class file. 4 00:00:12,660 --> 00:00:14,970 Not everything was inside the class file. 5 00:00:15,390 --> 00:00:17,550 We didn't have to mess around with the template. 6 00:00:17,820 --> 00:00:20,580 Reactive forms are mainly configured in the class. 7 00:00:20,940 --> 00:00:25,290 We can bind our forms to a reactive form with a set of directives. 8 00:00:25,770 --> 00:00:27,180 They're not our only option. 9 00:00:27,480 --> 00:00:31,050 Angular has an alternative module for working with forms. 10 00:00:31,320 --> 00:00:33,690 Things are different with template driven forms. 11 00:00:33,990 --> 00:00:37,350 Template driven forms are configured directly in the template. 12 00:00:37,680 --> 00:00:42,390 As we will soon find out, template driven forms can become bloated pretty fast. 13 00:00:42,960 --> 00:00:45,270 Template forms have a lower learning curve. 14 00:00:45,570 --> 00:00:47,010 They're much simpler to learn. 15 00:00:47,400 --> 00:00:52,140 Angular a semi automates the process of registering groups and controls. 16 00:00:52,500 --> 00:00:58,290 You may want to start using template forms if you're working with a simple form with fewer requirements. 17 00:00:58,650 --> 00:01:04,860 While it's not impossible to create complex forms, you will have a harder time creating dynamic forms. 18 00:01:05,760 --> 00:01:10,650 We are going to make our login form functional through angular template form system. 19 00:01:10,950 --> 00:01:13,560 Of course, we don't have to use this system. 20 00:01:13,800 --> 00:01:16,380 We can continue to use reactive forms. 21 00:01:16,620 --> 00:01:21,940 However, for demonstration purposes, I want to show you how to write template forms. 22 00:01:22,500 --> 00:01:26,340 If we want to use template forms, we need to register a module. 23 00:01:26,610 --> 00:01:30,690 It's similar to enabling reactive forms in an angular project. 24 00:01:30,990 --> 00:01:33,060 Open the user module file. 25 00:01:35,570 --> 00:01:38,900 The logging component is declared under this module. 26 00:01:39,170 --> 00:01:44,720 If we want to use template forms, we need to import the module into the user module. 27 00:01:45,200 --> 00:01:50,540 The module we are going to import can be found under the Angular Forms package. 28 00:01:50,900 --> 00:01:53,540 There is already an import statement for this package. 29 00:01:53,810 --> 00:01:58,340 We will update this import statement to include the Forms module object. 30 00:02:00,840 --> 00:02:04,950 Next, we will add the forms module to the imports option. 31 00:02:07,570 --> 00:02:13,810 We've successfully enabled template forms, and our project Angular is going to expose a set of directives 32 00:02:13,810 --> 00:02:15,910 for controlling forms in the template. 33 00:02:16,180 --> 00:02:19,330 Let's explore these directives in the next lecture. 34 00:02:19,360 --> 00:02:22,240 We are going to begin working on the login form.