trying to get a form set up but for some reason, the Date input in my html is not binding to the object\'s date value, despite using [(ngModel)]
html:
&l
Angular 2 completely ignores type=date
. If you change type to text
you'll see that your input
has two-way binding.
Here is pretty bad advise with better one to follow:
My project originally used jQuery
. So, I'm using jQuery datepicker
for now, hoping that angular team will fix the original issue. Also it's a better replacement because it has cross-browser support. FYI, input=date
doesn't work in Firefox.
Good advise: There are few pretty good Angular2 datepickers
:
https://github.com/emirdeliz/meus-projetos/tree/master/angular2-schedule/app/frontend/components/datepicker
https://github.com/MrPardeep/Angular2-DatePicker
https://www.npmjs.com/package/ng2-datepicker