File tree 1 file changed +4
-7
lines changed
1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -37,10 +37,10 @@ Let's start with input fields for quantity and cost whose values are multiplied
37
37
<div ng-app ng-init="qty=1;cost=2">
38
38
<b>Invoice:</b>
39
39
<div>
40
- Quantity: <input type="number" ng-model="qty" required >
40
+ Quantity: <input type="number" ng-model="qty">
41
41
</div>
42
42
<div>
43
- Costs: <input type="number" ng-model="cost" required >
43
+ Costs: <input type="number" ng-model="cost">
44
44
</div>
45
45
<div>
46
46
<b>Total:</b> {{qty * cost | currency}}
@@ -62,11 +62,8 @@ The first kind of new markup are the so called <a name="directive">"{@link direc
62
62
They apply special behavior to attributes or elements in the HTML. In the example above we use the
63
63
{@link ng.directive:ngApp `ng-app`} attribute, which is linked to a directive that automatically
64
64
initializes our application. Angular also defines a directive for the {@link ng.directive:input `input`}
65
- element that adds extra behavior to the element. E.g. it is able to automatically validate that the entered
66
- text is non empty by evaluating the `required` attribute.
67
- The {@link ng.directive:ngModel `ng-model`} directive stores/updates
68
- the value of the input field into/from a variable and shows the validation state of the input field by
69
- adding css classes. In the example we use these css classes to mark an empty input field with a red border.
65
+ element that adds extra behavior to the element. The {@link ng.directive:ngModel `ng-model`} directive
66
+ stores/updates the value of the input field into/from a variable.
70
67
71
68
<div class="alert alert-info">
72
69
**Custom directives to access the DOM**: In Angular, the only place where an application touches the DOM is
You can’t perform that action at this time.
0 commit comments