Server-side validation for form

前端 未结 4 423
北荒
北荒 2021-02-01 09:05

The default validation for the form I have works as expected. But when a user types in a valid email address and a password of three characters minimum, that doesn\'t mean the l

4条回答
  •  -上瘾入骨i
    2021-02-01 09:19

    Tosh shimayama gave the right answer. $setValidity is a method from the NgModelController and takes two parameters: validationErrorKey and isValid.

    More information on $setValidity

    Change the validity state, and notifies the form when the control changes validity. (i.e. it does not notify form if given validator is already marked as invalid).

    Source and further information AngularJS: NgModelController

提交回复
热议问题