Bind date value to date input

Description

The following code shows how to Bind date value to date input.

Example


<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.js"></script>
<script type='text/javascript'>
function MyCtrl($scope) {<!--from   w ww. j  a  v  a  2s .  co m-->
    $scope.dateVal = new Date(2013, 06,07);
}
</script>
</head>
<body>
  <div ng-controller="MyCtrl" ng-app>
     <input type="date" ng-model="dateVal" />
        <hr/>
    {{dateVal}}  </br>
</div>
</body>
</html>

Click to view the demo





















Home »
  AngularJS »
    AngularJS Example »




Controller
Directives
Expression
Filter
Form
Inject
Scope
Server
Style
Template
Utilities