@@ -104,12 +104,12 @@ Here is a directive which makes any element draggable. Notice the `draggable` at
104
104
<file name="index.html">
105
105
<span draggable>Drag ME</span>
106
106
</file>
107
- </file >
107
+ </example >
108
108
109
109
110
- The presence of `draggable` attribute an any element gives the element new behavior. The beauty of
111
- this approach is that we have thought the browser a new trick, we have extended the vocabulary of
112
- what browser understands in a way, which is natural to anyone who is familiar with HTML
110
+ The presence of `draggable` attribute on any element gives the element new behavior. The beauty of
111
+ this approach is that we have taught the browser a new trick. We have extended the vocabulary of
112
+ what the browser understands in a way, which is natural to anyone who is familiar with HTML
113
113
principles.
114
114
115
115
@@ -121,23 +121,21 @@ an element.
121
121
122
122
<img src="img/One_Way_Data_Binding.png">
123
123
124
- This means that any changes to the data, need to be re-merged with the template and then
124
+ This means that any changes to the data need to be re-merged with the template and then
125
125
`innerHTML`ed into the DOM. Some of the issues are: reading user input and merging it with data,
126
126
clobbering user input by overwriting it, managing the whole update process, and lack of behavior
127
127
expressiveness.
128
128
129
- Angular is different. Angular compiler consumes DOM with directives, not string templates. The
130
- result is a linking function, which when combined with a scope model results in live view. The
131
- view and scope model bindings are transparent, no action from the developer is needed to update
129
+ Angular is different. The Angular compiler consumes the DOM with directives, not string templates.
130
+ The result is a linking function, which when combined with a scope model results in a live view. The
131
+ view and scope model bindings are transparent. No action from the developer is needed to update
132
132
the view. And because no `innerHTML` is used there are no issues of clobbering user input.
133
- Furthermore, angular directives can contain not just text bindings, but behavioral constructs as
133
+ Furthermore, Angular directives can contain not just text bindings, but behavioral constructs as
134
134
well.
135
135
136
136
<img src="img/Two_Way_Data_Binding.png">
137
137
138
- The Angular approach produces stable DOM. This means that the DOM element instance bound to model
138
+ The Angular approach produces a stable DOM. This means that the DOM element instance bound to a model
139
139
item instance does not change for the lifetime of the binding. This means that the code can get
140
140
hold of the elements and register event handlers and know that the reference will not be destroyed
141
141
by template data merge.
142
-
143
-
0 commit comments