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:
mkolodny 2013-12-20 23:41:00 -05:00 committed by Igor Minar
parent 98473835a2
commit d1c4766d14

View file

@ -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',