Commit 18913d1b authored by dev0tion's avatar dev0tion

Fix password validation

parent 99df7bfe
...@@ -8,12 +8,17 @@ export class PasswordValidationDirective { ...@@ -8,12 +8,17 @@ export class PasswordValidationDirective {
constructor() { } constructor() { }
static MatchPassword(AC: AbstractControl) { static MatchPassword(AC: AbstractControl) {
AC.get('walletPassword').valueChanges.subscribe(() => {
AC.get('walletPasswordConfirmation').updateValueAndValidity();
});
let password = AC.get('walletPassword').value; let password = AC.get('walletPassword').value;
let confirmPassword = AC.get('walletPasswordConfirmation').value; let confirmPassword = AC.get('walletPasswordConfirmation').value;
if(password != confirmPassword) { if(password != confirmPassword) {
AC.get('walletPasswordConfirmation').setErrors( { walletPasswordConfirmation: true } ) AC.get('walletPasswordConfirmation').setErrors({ walletPasswordConfirmation: true });
} else { } else {
return null return null
} }
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment