Created
September 23, 2019 14:54
-
-
Save nicobytes/ac935c38f397670be4cb25613a0d9381 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static passwordMatchValidator(control: AbstractControl) { | |
const password: string = control.get('password').value; // get password from our password form control | |
const confirmPassword: string = control.get('confirmPassword').value; // get password from our confirmPassword form control | |
// compare is the password math | |
if (password !== confirmPassword) { | |
// if they don't match, set an error in our confirmPassword form control | |
control.get('confirmPassword').setErrors({ NoPassswordMatch: true }); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment