File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree 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
3737 <div ng-app ng-init="qty=1;cost=2">
3838 <b>Invoice:</b>
3939 <div>
40- Quantity: <input type="number" ng-model="qty" required >
40+ Quantity: <input type="number" ng-model="qty">
4141 </div>
4242 <div>
43- Costs: <input type="number" ng-model="cost" required >
43+ Costs: <input type="number" ng-model="cost">
4444 </div>
4545 <div>
4646 <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
6262They apply special behavior to attributes or elements in the HTML. In the example above we use the
6363{@link ng.directive:ngApp `ng-app`} attribute, which is linked to a directive that automatically
6464initializes 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.
7067
7168<div class="alert alert-info">
7269**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