From the course: Building Angular and ASP.NET Web API Apps
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Registering users
From the course: Building Angular and ASP.NET Web API Apps
Registering users
- [Instructor] Now that we created the view, let us create a formGroup which we are going to use to get the data from the form and then send this data to our API Endpoint. So, for that, go to the register folder. Inside the register folder, you will have the register.component.ts file and here, we are going to create our formGroup. So, let us write in here registerForm because the name that we define in here needs to be the same like in our html file, and here, we have defined that the name of our formGroup is going to be registerForm and then we define the type to be FormGroup. To create a FormBuilder, we need to first inject the FormBuilder module. So, for that, write in here private fb, which stands for FormBuilder, and then FormBuilder. Inside the constructor, write this.registerForm is equal to fb.group and then inside this formGroup, we need to define all the formControl names. So, the userName, the password, and the confirmPassword field. So, let's start with the first one…
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
-
-
-
-
-
-
-
-
-
(Locked)
Setting up AuthController5m 10s
-
(Locked)
Setting up AuthService3m 8s
-
(Locked)
Creating a register component5m 6s
-
(Locked)
Registering users6m 18s
-
(Locked)
Generating a token6m 53s
-
(Locked)
Requesting a token from Angular4m 42s
-
(Locked)
Authentication check via tokens5m 11s
-
(Locked)
Logging out users1m 54s
-
(Locked)
Creating an Angular login component4m 47s
-
(Locked)
Getting data from the login form4m 25s
-
(Locked)
Logging in users4m 20s
-
(Locked)
Handling errors in angular4m 2s
-
(Locked)
-
-