angular / angular.js

AngularJS - HTML enhanced for web apps!
https://angularjs.org
MIT License
58.81k stars 27.5k forks source link

ngModel does not work for input[type="date"] #1650

Closed th507 closed 11 years ago

th507 commented 11 years ago

Angular Version:

1.0.2

How to reproduce:

http://jsfiddle.net/rawVc/

Notes:

The documentation seems to hint that ng-model only supports input with one of these types text checkbox radio number email url

But I think if ng-model works on type="text", it should also work on newer types like type="date" and such.

johnnyelwailer commented 11 years ago

it should be maybe possible to enable support for custom types?

btford commented 11 years ago

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 (1.0.8 and 1.2.0-rc.1), and if the issue persists, comment below so we can discuss it.

Thanks!

anirvan-majumdar commented 10 years ago

Hello Brian,

I can confirm that this issue still persists as of Angular version 1.2.3. Auto-binding on an input type='text' doesn't work. I also tried setting the value attribute to the model's date value, but that too didn't work. Here's what I was trying —

<input type="date" id="inputStartDt" name="startDt" placeholder="Start date" ng-model="startDt"
                value="{{ startDt | date: 'dd/MM/yyyy' }}" >
ashclarke commented 10 years ago

Still exists in 1.2.10. Using Chrome 33 and the same sort of code as anirvan-majumdar, except I have tried date as "yyyy-MM-dd" and "dd/MM/yyyy".

caitp commented 10 years ago

@ashclarke there is work being done on this, I think we'll probably be able to ship @blesh's work fairly early in 1.3.

ashclarke commented 10 years ago

Thanks for the update @caitp!