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

Commit

Permalink
Refactor code to use ngModelController (instead of onChange listeners…
Browse files Browse the repository at this point in the history
…), add support for ngRequired and change license to MPL 2.0
  • Loading branch information
jfmcode committed Dec 7, 2016
1 parent 96d6b6c commit f32b2df
Show file tree
Hide file tree
Showing 7 changed files with 541 additions and 294 deletions.
4 changes: 2 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngComboDatePicker",
"version": "1.2.5",
"version": "1.3.0",
"authors": [
"jfmdev <[email protected]>"
],
Expand All @@ -16,7 +16,7 @@
"picker",
"combobox"
],
"license": "LGPL-3.0",
"license": "MPL-2.0",
"homepage": "http://jfmdev.github.io/ngComboDatePicker/",
"ignore": [
"**/.*",
Expand Down
18 changes: 18 additions & 0 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ <h2>Place holders</h2>
</div>

<h2>Form validation</h2>

<h3>Using inners &lt;select&gt;</h3>
<script type="text/javascript">
app.controller('formValidationCtrl', function ($scope) {

Expand Down Expand Up @@ -179,6 +181,22 @@ <h2>Form validation</h2>
</table>
</form>
</div>

<h3>Using ngRequired and name</h3>
<script type="text/javascript">
app.controller('requiredCtrl', function ($scope) {

});
</script>
<div ng-controller="requiredCtrl">
<form name="myOtherForm" novalidate>
<p>Choose a date: <ng-combo-date-picker ng-model="requiredDate" ng-required="true" name="my_date"></ng-combo-date-picker></p>
<p>Current selection is: <strong>{{ requiredDate }}</strong></p>
<p>Date selector is dirty: <strong>{{ myOtherForm.my_date.$dirty? 'Yes' : 'No' }}</strong></p>
<p>Date selector is valid: <strong>{{ myOtherForm.my_date.$invalid? 'No' : 'Yes' }}</strong></p>
<p>Form is valid: <strong>{{ myOtherForm.$invalid? 'No' : 'Yes' }}</strong></p>
</form>
</div>

</div>
</body>
Expand Down
Loading

0 comments on commit f32b2df

Please sign in to comment.