Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@Component({
selector: 'app-reactive-password-validator',
templateUrl: './password-validator.component.html',
styleUrls: ['./password-validator.component.css']
})
export class ReactiveFormPasswordValidatorComponent implements OnInit {
form: FormGroup;
value: string;
password = new FormControl('', Validators.compose([
//Validators.required,
PasswordValidators.repeatCharacterRegexRule(4),
PasswordValidators.alphabeticalCharacterRule(1),
PasswordValidators.digitCharacterRule(1),
PasswordValidators.lowercaseCharacterRule(1),
PasswordValidators.uppercaseCharacterRule(1),
PasswordValidators.specialCharacterRule(1)
]));
confirmPassword = new FormControl('');
constructor(protected _fb: FormBuilder) { }
ngOnInit() {
this.form = this._fb.group({
'newPassword': this.password,
'confirmPassword': this.confirmPassword
});
this.form.setValidators(PasswordValidators.mismatchedPasswords());
}
getHintClass(formName: string, errorId: string): string {