Is there an ng-model and input type email bug?

后端 未结 4 1503
执笔经年
执笔经年 2021-02-07 05:58

Is there something special going on with input type=\"email\" and ng-model attribute? If the input is email, then the model doesnt update. If I change the input type to text, nu

4条回答
  •  忘掉有多难
    2021-02-07 06:22

    A complement, you can use properties on you form to see if your email is valid, like this :

    HTML:

    Javascript:

    //[formName].[inputFieldName].property 
    myForm.email1.$pristine;
    // Boolean. True if the user has not yet modified the form.
    myForm.email1.$dirty
    // Boolean. True if the user has already modified the form.
    myForm.email1.$valid
    // Boolean.True if the the form passes the validation.
    myForm.email1.$invalid
    // Boolean. True if the the form doesn't pass the validation.
    myForm.email1.$error
    

    Reference

提交回复
热议问题