表单验证仅在ngModel更新之前触发 我应该设置一个选项吗?在我输入时,会触发验证 在更新ngModel之前
<input type="password" class="form-control"
[class.backend-error]="!accountModel.password.valid"
[placeholder]="passwordLabel"
(ngModelChange)="syncModel($event, accountModel.password.key, password.valid)"
[(ngModel)]="accountModel.password.value"
required
pattern="^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{6,}$"
minlength="6"
name="password" #password="ngModel"/>
我应该将所有验证都移到js吗?