Injecting Validators

In this lesson, we'll learn how to use our custom validators using dependency injection.

The validator we created must be applied to form groups because the validate function is expecting a form group. This is because we want access to both passwords. By applying the validator to the form group, we’ll have access to all form controls.

Let’s update the validate function to check if the passwords match.

Get hands-on with 1200+ tech skills courses.