How to use the ngx-validators.PasswordValidators.uppercaseCharacterRule function in ngx-validators

To help you get started, we’ve selected a few ngx-validators examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Nightapes / ngx-validators / examples / src / app / reactive-forms / password-validator / password-validator.component.ts View on Github external
@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 {