Angular 2 form validation, minLength validator is not working

前端 未结 7 1646
旧巷少年郎
旧巷少年郎 2021-02-06 21:04

I have following Angular 2 form:


    
&l
相关标签:
7条回答
  • 2021-02-06 21:37

    The error key is minlength and not minLength:

    <div *ngIf = "password.hasError('minlength') && !password.hasError('required')" class = "alert alert-danger">
      <span>Password should contain 6 characters</span>
    </div>  
    
    0 讨论(0)
提交回复
热议问题