Binding problem with input type=number


#1

I have an input field tied through an ng-model to a range slider. If I make the input field it works fine, but if I make it it no longer tracks with the slider. I have a feeling it might be some interference between the HTML 5 and the angular.js , but what do I know, I’m a newbie. Plunker here:

Is there a way to make this work?


#2

The problem is that input number only takes an integer and both input text and range return a string. I made a not so pretty fix with a $watch that return the model value as an int and it now works in all input types.


#3

I see. Thank you very much!


#4

Here is one way you can solve it: http://plnkr.co/edit/9DsJWZsbyNs8aP44So5l?p=preview