-
Notifications
You must be signed in to change notification settings - Fork 27.4k
input["email"] and ngRequired are not working together anymore #7849
Comments
thanks for the bug report, I can confirm this. would you be interested in putting together a fix? The behaviour should be somewhat similar to native constraint validation (http://jsfiddle.net/ep4Bf/) |
yes, i will have a look On Mon, Jun 16, 2014 at 5:02 PM, Caitlin Potter [email protected]
|
i would propose the following in function emailInputType(scope, element, attr, ctrl, $sniffer, $browser) {
textInputType(scope, element, attr, ctrl, $sniffer, $browser);
var emailValidator = function(value) {
return ctrl.$isEmpty(value) || EMAIL_REGEXP.test(value);
};
ctrl.$validators.email = emailValidator;
} i tested it and it worked on my project. Other validators such as url and would need to be rewritten too. Do you want me to fork and pull request ? |
Definitely. If you need help don't hesitate to ask =) |
Ok thanks! well yes I would need some help, this is my first attempt to help so i'm a bit lost... i wrote a test case in |
@swisstofu Does the test suite finish at all? You can execute specific tests with changing |
@Narretz thanks for your answer. i was able to run test suite but i had to remove test suite wasn't completed because of other issues, but my test case works just fine so i would be ready to submit... i've created a branch but i'm not able to push it to angular repo (well that's sounds logical...). @caitp how can I get the rights to do so ? or should I provide you with a fork ? i don't know the procedure sorry for that! thx for your help! |
@swisstofu You have to fork the angular.js repo on github. Then push your branch on the forked repo (remote) and initiate a pull request. Forking / creating a pull request is only possible from the github site / api, not from shell. |
…/ eachother ngRequired added to an email field wasn't working properly. ng-invalid-required stayed true unless a valid email was entered. correct behaviour is that it turns to ng-valid-required at first entered key. Closes angular#7849
input["email"] and ngRequired are not working together anymore
version :
1.3.0-beta.11
browsers:
chrome, safari
OS:
osx mavericks
hi guys, there is a regression in 1.3.x, that you can easily reproduce.
myForm.$error.required
istrue
, which is correctmyForm.$error.required
is stilltrue
, and this is wrongthis used to work in stable version (https://code.angularjs.org/1.2.18/docs/api/ng/input/input%5Bemail%5D)
thanks
The text was updated successfully, but these errors were encountered: