Closed shayanhusaini closed 7 years ago
Hi shayanhusaini.
The passwords validation should be used on a group not on control.
this.password = this.formBuilder.control('', [
ValidationExtensions.required('Password is required.'),
ValidationExtensions.minLength(3, 'Password must be more than 3 symbols.'),
ValidationExtensions.maxLength(20, 'Password must be less than 20 symbols.'),
]);
this.confirmPassword = this.formBuilder.control('', [
ValidationExtensions.required('Confirm Password is required.'),
ValidationExtensions.minLength(3, 'Password must be more than 3 symbols.'),
ValidationExtensions.maxLength(20, 'Password must be less than 20 symbols.'),
]);
// VALIDATION
this.passwordsGroup = this.formBuilder.group({
password: this.password,
confirmPassword: this.confirmPassword,
}, { validator: ValidationExtensions.passwords() });
You can check the demo app here: https://github.com/d-kostov-dev/ng2-mdf-validation-messages/blob/master/demo-app/src/app.component.ts
Hi, I am using your extension for my project. My application broke when i use the passwords validation method in reset password page. Below is my code:
I got the following error: