Skip to content

Commit

Permalink
Add ng-repeat input box example
Browse files Browse the repository at this point in the history
How to make it support multiple input box for the same validator #63
  • Loading branch information
hueitan committed Dec 8, 2014
1 parent 8b1b46f commit 64b8eee
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
5 changes: 5 additions & 0 deletions demo/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@
}
};

$scope.form6 = {
required: [{}, {}, {}], // ng-repeat
checkValid: $validationProvider.checkValid
};

// Callback method
$scope.success = function (message) {
alert('Success ' + message);
Expand Down
17 changes: 17 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,23 @@ <h1>Angular Validation.
<!-- <pre>{{ form | json }}</pre> -->
</form>
</div>

<div class="small-12 medium-12 large-6 columns">
<form name="Form6" id="form6">
<fieldset>
<legend>Form (ng-repeat)</legend>
<label>Required</label>
<input type="text" name="emailRequiredOnly{{$index}}" ng-model="a.required" validator="required" ng-repeat="a in form6.required"/>
</fieldset>

<ul class="button-group">
<li><button class="button" validation-submit="Form6">Submit</button></li>
<li><button class="button alert" validation-reset="Form6">Reset</button></li>
<li><button class="button secondary" ng-disabled="!form6.checkValid(Form6)">checkValid = {{ form6.checkValid(Form6) }}</button></li>
</ul>
<!-- <pre>{{ form | json }}</pre> -->
</form>
</div>
</div>

<a href="https://github.com/huei90/angular-validation"><img src="demo/iconmonstr-github-10-icon-128.png" id="github-link" alt="Fork me on Github"/></a>
Expand Down

0 comments on commit 64b8eee

Please sign in to comment.