From the course: Building Angular and ASP.NET Web API Apps
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
Getting data from the login form
From the course: Building Angular and ASP.NET Web API Apps
Getting data from the login form
- [Instructor] Now that we have created the view of the login component, let us see how we can get the data from our view, to our typescript file, and then send the request to our back-end code. So, let's get started. For the login view, instead of creating a reactive form, we are going to use a template driven form. So for that, let us import the forms module. To import the module, we need to go to the app.module.ts file. And in the form section, import the forms module. So, import, FormsModule from angular, slash forms. Or you can just add the module inline to any file, by writing in here, comma, and then FormsModule. And then remove the line, 26. Let us also write up here, components. And then cut all the components from line 28 to 31, and put them up here. We imported the forms module, but to be able to use it, we need to include it in our imports array. So after the ReactiveFormsModule, write in here, FormsModule. And this is all you have to do in your app.module.ts file. Now…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
Setting up AuthController5m 10s
-
Setting up AuthService3m 8s
-
Creating a register component5m 6s
-
Registering users6m 18s
-
Generating a token6m 53s
-
Requesting a token from Angular4m 42s
-
Authentication check via tokens5m 11s
-
Logging out users1m 54s
-
Creating an Angular login component4m 47s
-
Getting data from the login form4m 25s
-
Logging in users4m 20s
-
Handling errors in angular4m 2s
-
-
-