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

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Register for a new account

Register for a new account

- [Instructor] In this part, we're going to work on the signup form where we're going to set up both the HTML file and also the component. So for that in here, I'll just go to components, then go to signup and open both the HTML file and the TypeScript file. Let us start with the TypeScript form. In here, because we are going to use a reactive form and also the router link, I'm just going to import the CommonModule, import the ReactiveFormsModule, and the RouterLink. Then down here, then I'll just define the signupForm, which is going to be a FormGroup, and then use the constructor to create or to set up the signupForm. Just in here, we need to inject in here the form builder, so private fb, the type is going to be the FormBuilder. Then inside the constructor is going to type this.signupForm is equal to this.fb: FormBuilder.group. And then here we are going to define that we have the property email, which is going to be required and also a valid email address. So just like this…

Contents