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

Registering users

From the course: Building Angular and ASP.NET Web API Apps

Start my 1-month free trial

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…

Contents