Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit fcd76d2

Browse files
sixinlipetebacondarwin
authored andcommitted
docs(guide/concepts): add min to numerical inputs
Closes #8495
1 parent a390612 commit fcd76d2

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

docs/content/guide/concepts.ngdoc

+8-8
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ Let's start with input fields for quantity and cost whose values are multiplied
3737
<div ng-app ng-init="qty=1;cost=2">
3838
<b>Invoice:</b>
3939
<div>
40-
Quantity: <input type="number" ng-model="qty">
40+
Quantity: <input type="number" min="0" ng-model="qty">
4141
</div>
4242
<div>
43-
Costs: <input type="number" ng-model="cost">
43+
Costs: <input type="number" min="0" ng-model="cost">
4444
</div>
4545
<div>
4646
<b>Total:</b> {{qty * cost | currency}}
@@ -128,10 +128,10 @@ different currencies and also pay the invoice.
128128
<div ng-app="invoice1" ng-controller="InvoiceController as invoice">
129129
<b>Invoice:</b>
130130
<div>
131-
Quantity: <input type="number" ng-model="invoice.qty" required >
131+
Quantity: <input type="number" min="0" ng-model="invoice.qty" required >
132132
</div>
133133
<div>
134-
Costs: <input type="number" ng-model="invoice.cost" required >
134+
Costs: <input type="number" min="0" ng-model="invoice.cost" required >
135135
<select ng-model="invoice.inCurr">
136136
<option ng-repeat="c in invoice.currencies">{{c}}</option>
137137
</select>
@@ -228,10 +228,10 @@ Let's refactor our example and move the currency conversion into a service in an
228228
<div ng-app="invoice2" ng-controller="InvoiceController as invoice">
229229
<b>Invoice:</b>
230230
<div>
231-
Quantity: <input type="number" ng-model="invoice.qty" required >
231+
Quantity: <input type="number" min="0" ng-model="invoice.qty" required >
232232
</div>
233233
<div>
234-
Costs: <input type="number" ng-model="invoice.cost" required >
234+
Costs: <input type="number" min="0" ng-model="invoice.cost" required >
235235
<select ng-model="invoice.inCurr">
236236
<option ng-repeat="c in invoice.currencies">{{c}}</option>
237237
</select>
@@ -356,10 +356,10 @@ The following example shows how this is done with Angular:
356356
<div ng-app="invoice3" ng-controller="InvoiceController as invoice">
357357
<b>Invoice:</b>
358358
<div>
359-
Quantity: <input type="number" ng-model="invoice.qty" required >
359+
Quantity: <input type="number" min="0" ng-model="invoice.qty" required >
360360
</div>
361361
<div>
362-
Costs: <input type="number" ng-model="invoice.cost" required >
362+
Costs: <input type="number" min="0" ng-model="invoice.cost" required >
363363
<select ng-model="invoice.inCurr">
364364
<option ng-repeat="c in invoice.currencies">{{c}}</option>
365365
</select>

0 commit comments

Comments
 (0)