material icon indicating copy to clipboard operation
material copied to clipboard

Md-input-container validation for email using ng-messages is not working properly

Open yugalbagul opened this issue 10 years ago • 4 comments

Hi, I am trying to show multiple ng-messages for form validation having an email input field.

The validation works once for only one case , either required or invalid email. After selecting any other filed or changing the input field , the validations does not work.

Here is a codepen depicting the issue -

http://codepen.io/Yugal/pen/qZrBwz?editors=1000

It works good without md-input-container as seen here

http://plnkr.co/edit/?p=preview

Is this an issue??

yugalbagul avatar Mar 19 '16 07:03 yugalbagul

Not an issue, which is related to Angular Material.

See simple email validation using plain ngMessages.

  • http://codepen.io/DevVersion/pen/LNWNpy

In this case, I suggest using a pattern, like in the demos.

ng-pattern="/^.+@.+\..+$/"

I will close this issue, because it's not related to ngMaterial.

devversion avatar Mar 19 '16 19:03 devversion

Hi @DevVersion

Unfortunately after using ng-pattern as well the issue persists.

Update Codepen - http://codepen.io/Yugal/pen/qZrBwz/?editors=1000

I have added file "Email3" which is without . Which works fine.

Filed "Email2" is having ng-pattern validation. For this the form validation only works once.

I think the issue is with ..

yugalbagul avatar Mar 24 '16 16:03 yugalbagul

Can this issue be re-opened if it is legit ??

yugalbagul avatar Mar 26 '16 09:03 yugalbagul

Hey @yugalbagul,

ng-pattern works fine for the validation, the message is just not showing up. We already have an issue, which tracks that. #6399

devversion avatar Mar 26 '16 10:03 devversion