parent
f60703d2d4
commit
d057f73c02
|
@ -571,15 +571,14 @@ a(id="one-time-initialization")
|
||||||
The following binding pairs do the same thing:
|
The following binding pairs do the same thing:
|
||||||
+makeExample('template-syntax/ts/app/app.component.html', 'property-binding-vs-interpolation')(format=".")
|
+makeExample('template-syntax/ts/app/app.component.html', 'property-binding-vs-interpolation')(format=".")
|
||||||
:marked
|
:marked
|
||||||
Interpolation is a convenient alternative for property binding in many cases.
|
_Interpolation_ is a convenient alternative to _property binding_ in many cases.
|
||||||
In fact, Angular translates those interpolations into the corresponding property bindings
|
|
||||||
before rendering the view.
|
|
||||||
|
|
||||||
There is no technical reason to prefer one form to the other.
|
When rendering data values as strings, there is no technical reason to prefer one form to the other.
|
||||||
We lean toward readability, which tends to favor interpolation.
|
We lean toward readability, which tends to favor interpolation.
|
||||||
We suggest establishing coding style rules and choosing the form that
|
We suggest establishing coding style rules and choosing the form that
|
||||||
both conforms to the rules and feels most natural for the task at hand.
|
both conforms to the rules and feels most natural for the task at hand.
|
||||||
|
|
||||||
|
When setting an element property to a non-string data value, you must use _property binding_.
|
||||||
|
|
||||||
:marked
|
:marked
|
||||||
#### Content security
|
#### Content security
|
||||||
|
|
Loading…
Reference in New Issue