-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Add support for the input type=range #1189
Comments
The behavior of the number input type is correct. What could be done here is to add support for the Even if browsers support for the range isn't great (http://caniuse.com/#search=range) still people would mostly expect a number from the input type range. |
I agree; I would expect input(type=range) to yield a number in its ngModel. Thanks for working on this. |
As part of our effort to clean out old issues, this issue is being automatically closed since it has been inactivite for over two months. Please try the newest versions of Angular ( Thanks! |
As of v1.2.1, the issue persists |
Same in v1.2.3. |
I just ran up against this problem. Very frustrating. |
I encountered this issue where the slider toggle becomes stuck at 0 or 100 if the model is outside that range. |
It looks like closed tickets are never looked at again so asking nicely to reopen doesn't work. I've reposted this issue here: #5892 |
Bind model of <input type="range"> to number (like <input type="number">) rather than string. Range inputs represent numerical values; therefore, a numerical binding makes more sense than a string binding. Closes angular#1189, angular#5892
div ng-app ng-controller="Ctrl"> function Ctrl($scope) { Just change it to parseInt(); |
With multiple inputs to the same model
<input type="number" />
doesn't play ball. It works as an input but updating it to a value set from another input always fails. Even if the source is also constrained as numeric (type="range"
in chrome). This is due to the model being stored as a string.Demo: http://jsfiddle.net/TXazw/5/Edit
Edit any input except the number and everything updates except the number input. Edit the number input and everything works fine.
A workaround is included. Uncomment parseFloat line and all inputs work correctly.
Should values not be automatically parsed when applied to a number type input? At the very least
type="range"
should be outputting a number rather than a string.Discussed in the group:
https://groups.google.com/forum/?fromgroups#!topic/angular/Ecjx2fo8Qvk
The text was updated successfully, but these errors were encountered: