-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Document ngRequired change in changelog. #9141
Comments
duplicate of #9106 |
the weird thing in your demo is that the model controller gets a "number" error but not a "required" error, but in debugging, number parsing succeeds but required validation fails. I must be missing something. I think this would be the correct behaviour if the correct error were reported, however |
@caitp Why should 1.3.0-rc.2 have a required error when ng-required="1==2" evaluates to false. If ng-required=false, I would expect that the number input should pass validation when undefined as it does in 1.3.0-beta.19 and below. |
because ng-required doesn't evaluate an expression or worry about the result of the expression |
@caitp since when? Am I misusing the term "expression" in this context? ngRequired evaluating an expression successfully in beta.19: http://codepen.io/ItsLeeOwen/pen/EslLp #9106 suggests that the behavior since rc.1 is a regression bug. |
I'm pretty sure the only difference is that ngRequired now validates the model value rather than the view value (which is probably not the right behaviour). It didn't evaluate an expression before, as far as I can tell (or if it did, it wasn't doing it in the requiredDirective) |
@caitp:
LOL - I was always under the assumption that it worked that way (I am not sure I ever tested it though). This is strange... |
I dunno, it probably did, but we broke it somehow and it's not listed as a breaking change. However looking at the blame for that directive, I don't see an obvious culprit |
That's the funny thing. Looking at the code from 1.0.5 until 1.3.0-beta.x there doesn't seem to be anything about that directive that should make it work the way it is described. And yet it does !!! Spooky... |
First mystery solved: It's one of the BOOLEAN_ATTR attributes. |
We should probably move over to the #9106 issue, I closed this one because it appears to be a dupe. |
Since rc.1 when a number input is undefined, ngRequired expressions are now ignored by validation. For example ng-required="1==2" has always passed validation, but now it does not.
1.3.0-beta.19: http://codepen.io/ItsLeeOwen/pen/Fjxnh
same code in 1.3.0-rc.2: http://codepen.io/ItsLeeOwen/pen/aAzrL
The text was updated successfully, but these errors were encountered: