Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Can't share a data-ng-model between <input type="number" /> and <input type="range" /> #8241

Closed
zippy1981 opened this issue Jul 17, 2014 · 2 comments

Comments

@zippy1981
Copy link

I demonstrate the issue in a plunkr here . This stackoverflow answer describes the issue in detail.

Simply put, at least in chrome <input type="number" />.value is a number. and <input type="range" />.value is a string, so that's what is breaking the data-ng-model binding. That could be fixed with some casting with the ngModel directive (and possibly the ngBind directive).

On another note, the w3c spec for number input and range input both say the value should be a string representation of a number. Is this worth filing a bug with chrome over?

@Narretz Narretz added this to the Backlog milestone Jul 21, 2014
@Narretz
Copy link
Contributor

Narretz commented Jul 21, 2014

Hey @zippy1981, I edited your post so that the html tags show up. The general problem is that currently angular has no special range handling, but if it is added, this should be considered.

@btford btford removed the gh: issue label Aug 20, 2014
cironunes added a commit to cironunes/angular.js that referenced this issue Oct 21, 2014
the input[type=range] behavior is the same of an input[type=number]
with min=0, max=100 and step=1 as defaults

Closes angular#5892, angular#8241, angular#7370
cironunes added a commit to cironunes/angular.js that referenced this issue Oct 21, 2014
the input[type=range] behavior is the same of an input[type=number]
with min=0, max=100 and step=1 as defaults

Closes angular#5892, angular#8241, angular#7370
@Narretz
Copy link
Contributor

Narretz commented Jul 5, 2016

We are working on this (finally). Closing as a duplicate of #5892

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants