Skip to content
This repository was archived by the owner on Mar 9, 2022. It is now read-only.

Commit f32b2df

Browse files
committed
Refactor code to use ngModelController (instead of onChange listeners), add support for ngRequired and change license to MPL 2.0
1 parent 96d6b6c commit f32b2df

File tree

7 files changed

+541
-294
lines changed

7 files changed

+541
-294
lines changed

bower.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ngComboDatePicker",
3-
"version": "1.2.5",
3+
"version": "1.3.0",
44
"authors": [
55
"jfmdev <[email protected]>"
66
],
@@ -16,7 +16,7 @@
1616
"picker",
1717
"combobox"
1818
],
19-
"license": "LGPL-3.0",
19+
"license": "MPL-2.0",
2020
"homepage": "http://jfmdev.github.io/ngComboDatePicker/",
2121
"ignore": [
2222
"**/.*",

demo/index.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ <h2>Place holders</h2>
145145
</div>
146146

147147
<h2>Form validation</h2>
148+
149+
<h3>Using inners &lt;select&gt;</h3>
148150
<script type="text/javascript">
149151
app.controller('formValidationCtrl', function ($scope) {
150152

@@ -179,6 +181,22 @@ <h2>Form validation</h2>
179181
</table>
180182
</form>
181183
</div>
184+
185+
<h3>Using ngRequired and name</h3>
186+
<script type="text/javascript">
187+
app.controller('requiredCtrl', function ($scope) {
188+
189+
});
190+
</script>
191+
<div ng-controller="requiredCtrl">
192+
<form name="myOtherForm" novalidate>
193+
<p>Choose a date: <ng-combo-date-picker ng-model="requiredDate" ng-required="true" name="my_date"></ng-combo-date-picker></p>
194+
<p>Current selection is: <strong>{{ requiredDate }}</strong></p>
195+
<p>Date selector is dirty: <strong>{{ myOtherForm.my_date.$dirty? 'Yes' : 'No' }}</strong></p>
196+
<p>Date selector is valid: <strong>{{ myOtherForm.my_date.$invalid? 'No' : 'Yes' }}</strong></p>
197+
<p>Form is valid: <strong>{{ myOtherForm.$invalid? 'No' : 'Yes' }}</strong></p>
198+
</form>
199+
</div>
182200

183201
</div>
184202
</body>

0 commit comments

Comments
 (0)