aboutsummaryrefslogtreecommitdiffstats
path: root/docs/content/guide/overview.ngdoc
diff options
context:
space:
mode:
authorJared Beck2013-04-17 18:26:49 -0300
committerPete Bacon Darwin2013-04-19 14:40:39 +0100
commit3508f76719246af644b9ffa6ea756623b75219b8 (patch)
tree50a8220c26eeffb14d402c377dae23cc725fce5e /docs/content/guide/overview.ngdoc
parenta7d081fac037166fab1ea0b1aacabb6e091a1852 (diff)
downloadangular.js-3508f76719246af644b9ffa6ea756623b75219b8.tar.bz2
docs(overview): correct the input validation example
The documentation says that the input should be red if you enter invalid values or leave it blank. Because the type="integer" is not supported this does not happen in practice. This fix changes the input type to number and adds an ng-pattern to ensure that the number is an integer.
Diffstat (limited to 'docs/content/guide/overview.ngdoc')
-rw-r--r--docs/content/guide/overview.ngdoc4
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/content/guide/overview.ngdoc b/docs/content/guide/overview.ngdoc
index 2e10b401..837c0a3f 100644
--- a/docs/content/guide/overview.ngdoc
+++ b/docs/content/guide/overview.ngdoc
@@ -90,7 +90,7 @@ concepts which the application developer may face:
<table>
<tr><td>Quantity</td><td>Cost</td></tr>
<tr>
- <td><input type="integer" min="0" ng-model="qty" required ></td>
+ <td><input type="number" ng-pattern="/\d+/" step="1" min="0" ng-model="qty" required ></td>
<td><input type="number" ng-model="cost" required ></td>
</tr>
</table>
@@ -124,7 +124,7 @@ We load Angular using the `<script>` tag:
From the `ng-model` attribute of the `<input>` tags, Angular automatically sets up two-way data
binding, and we also demonstrate some easy input validation:
- Quantity: <input type="integer" min="0" ng-model="qty" required >
+ Quantity: <input type="number" ng-pattern="/\d+/" step="1" min="0" ng-model="qty" required >
Cost: <input type="number" ng-model="cost" required >
These input widgets look normal enough, but consider these points: