blob: a286733536fdbe8050c894cbb4824e98e0800ab1 [file]
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Example - example-time-input-directive</title>
<script src="../../../angular.min.js"></script>
</head>
<body ng-app="">
<script>
function Ctrl($scope) {
$scope.value = new Date(0, 0, 1, 14, 57);
}
</script>
<form name="myForm" ng-controller="Ctrl as dateCtrl">
Pick a between 8am and 5pm:
<input type="time" id="exampleInput" name="input" ng-model="value"
placeholder="HH:mm" min="08:00" max="17:00" required />
<span class="error" ng-show="myForm.input.$error.required">
Required!</span>
<span class="error" ng-show="myForm.input.$error.time">
Not a valid date!</span>
<tt>value = {{value | date: "HH:mm"}}</tt><br/>
<tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>
<tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>
<tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
<tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>
</form>
</body>
</html>