Bind to input date

Description

The following code shows how to Bind to input date.

Example


<!DOCTYPE html>
<html  ng-app>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.js"></script>
</head><!--from ww  w .j  av  a2  s . c  o m-->

<body>
  <div ng-app="miniapp">
    <div ng-controller="Ctrl">
        <label class="control-label" for="inputStart">Start Date:</label>
        <input type="date" id="inputStart" data-ng-model="startDate" /><br />
        <span>{{ startDate | date:'fullDate' }}</span><br />
        <span>{{ startDate }}</span>
    </div>
</div>
<script type='text/javascript'>
var $scope;
var app = angular.module('miniapp', []);
function Ctrl($scope) {
    $scope.form = {}
}
</script>
</body>
</html>

Click to view the demo





















Home »
  AngularJS »
    AngularJS Example »




Controller
Directives
Expression
Filter
Form
Inject
Scope
Server
Style
Template
Utilities