Set default value of HTML5 date input field with angularJS

Working fiddle

{{date | date:'MM/dd/yyyy'}}

I changed the it to date and add date filter.


value="{{date}}" 

causes init error: The specified value "{{datum_default}}" does not conform to the required format, "yyyy-MM-dd".

solution: do not set date in the template!

<input type="date" ng-model="date_code">

assign the date in controller!

$scope.date_code = new Date();

If you're using chrome you have to specify the Date format as 'yyyy-MM-dd'.

$scope.date = $filter("date")(Date.now(), 'yyyy-MM-dd');

It simply won't work otherwise. Here's a working version http://jsfiddle.net/bF9Pq/4/