mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-27 06:54:01 +00:00
docs(guide/forms): update example
Right now, non-integers such as 'aawefwae' are valid. This ensures that only integers are valid. Hopefully that makes the example more powerful. Closes #5501
This commit is contained in:
parent
98473835a2
commit
d1c4766d14
1 changed files with 1 additions and 1 deletions
|
|
@ -235,7 +235,7 @@ In the following example we create two directives.
|
||||||
<script>
|
<script>
|
||||||
var app = angular.module('form-example1', []);
|
var app = angular.module('form-example1', []);
|
||||||
|
|
||||||
var INTEGER_REGEXP = /^\-?\d*$/;
|
var INTEGER_REGEXP = /^\-?\d+$/;
|
||||||
app.directive('integer', function() {
|
app.directive('integer', function() {
|
||||||
return {
|
return {
|
||||||
require: 'ngModel',
|
require: 'ngModel',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue