Skip to content
This repository was archived by the owner on May 28, 2019. It is now read-only.

Commit 49c7c6c

Browse files
committed
docs(demo): Update the demo with required example
1 parent b95151b commit 49c7c6c

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

demo/index.html

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,38 @@
88
<link rel="stylesheet" href="bower_components/jquery-ui/themes/smoothness/jquery-ui.css">
99
</head>
1010

11-
<body ng-app="ui.date">
11+
<body ng-app="MyApp">
1212
<!-- Date -->
1313
<div ng-controller='MyCtrl'>
14-
<label for="date">Select Date:</label>
15-
<input type="text" id="date" ui-date="dateOptions" ng-model="aDate">
1614

17-
<div>{{ aDate }}</div>
18-
<a href="#" ng-click="logDate()">log date</a>
15+
<form name="myForm">
16+
17+
<label for="date">Select Date:</label>
18+
<input type="text" id="date" ui-date="dateOptions" ng-model="aDate">
19+
20+
<div>{{ aDate }}</div>
21+
22+
23+
<div class="field">
24+
Required date: <input type="text" name="date2" required ui-date="" ng-model="reqDate">
25+
<div ng-if="myForm.date2.$error.required">
26+
The required date field is required.
27+
</div>
28+
</div>
29+
</form>
30+
1931
</div>
2032
<!-- Scripts -->
2133
<script type="text/javascript" src="bower_components/jquery/dist/jquery.js"></script>
2234
<script type="text/javascript" src="bower_components/jquery-ui/jquery-ui.min.js"></script>
2335
<script type="text/javascript" src="bower_components/angular/angular.js"></script>
2436
<script type="text/javascript" src="assets/date.js"></script>
2537
<script>
26-
angular.module('ui.date').controller('MyCtrl', function($scope) {
38+
angular.module('MyApp', ['ui.date'])
39+
.controller('MyCtrl', function($scope) {
2740
$scope.aDate = '2015-10-31';
2841
$scope.dateOptions = {
29-
// dateFormat: 'dd/mm/yy',
30-
}
31-
$scope.logDate = function(){
32-
console.log($scope.aDate);
42+
dateFormat: 'dd.mm.yy',
3343
}
3444
})
3545
</script>

0 commit comments

Comments
 (0)