Validating and Submitting the Login Form

In this lesson, we'll start making the login form functional by adding validation and handling the form submission.

We’re going to shift our focus over to the login form. Login forms are used to authenticate the users into the application. We’ve taken care of creating a login form with groups and controls. There are two inputs: one for the email and another for the password.

We’re going to make it functional by adding validation, handling the submission, sending the data to Firebase, and handling the response. In this lesson, we’ll focus on the validation and submission parts of this process.

Validating the login form

The validation for the login form will be straightforward. We’ll mostly copy the validators we used for the registration form, except for the custom validators. We don’t need to check if the password is compromised again.

We’ll update the login.component.ts component class file to the following:

Get hands-on with 1200+ tech skills courses.