-
Notifications
You must be signed in to change notification settings - Fork 27.4k
ngMin/ngMax don't set min/max attributes #11636
Comments
Could you elaborate? What is the actual use-case? |
In Chrome, if there's a |
Why not just use |
I think |
Basically, most of the validation directives ( |
I wasn't saying these would be needed or useful for the same reason as If |
Yes and...no :) |
yes, but the benefit of Take this example: <input type="date" ng-model="minDate">
<input type="date" ng-model="date" ng-min="minDate"> Can you give me an example of what you mean? |
@twhitbeck, you can use interpolation (with
|
But what if I want to bind to a date, not a string, as in my example? In my situation I have one this might be out of scope, but I just wanted to suggest it as a nice-to-have. There is no documentation on
|
I know it's annoying that Your comment mentions The difference between them (funtinality-wise), which is also the reason why Angular supports both forms and why it is not a good idea for So, each one is appropriate for different usecases. The only thing that I think can be improved here, is a mention in the docs that (for date-related inputs), if you want both Angular and HTML5 validation, you can use |
@gkalpak How is that different from ngRequired also activating HTML5 form validation? Consider that according to the HTML5 spec at least for the number input the attribute |
@realityking, as already emntioned,
I don't see how that relates to the discussion above. You are free to use Also, note that |
BTW, there seems to be a bug in |
@gkalpak I think I see the big picture, now. I think the solution is to amend the documentation on date related inputs, as you say. For one, there should be a mention of |
@twhitbeck or anyone else, would you be interested in submitting a PR to update the docs ? |
Yes I'll probably get to it sometime next week |
Bump for documentation. |
I'm trying to get to this, but having issues building on windows. |
@twhitbeck, what kind of issues ? |
It'd be nice if ngMin and ngMax set the
min
andmax
attributes accordingly. Similarly to howngSrc
andngHref
do. I realize I can useng-attr-min
andng-attr-max
, but that extra step seems unnecessary.Ideally, for date types the same date parsing/formatting would be used as in the input directive for the respective types, but this behavior should happen even when there's no
ngModel
directive on the element. That means this needs to happen outside the directive linking function (since it doesn't get called if there's nongModel
directive present).The text was updated successfully, but these errors were encountered: