From d057f73c02bdb396a5825aab2d92d8e05e8a65d3 Mon Sep 17 00:00:00 2001 From: Ward Bell Date: Mon, 2 Jan 2017 17:50:14 -0800 Subject: [PATCH] docs(template-syntax): interpolation only for strings #3041 (#3066) --- public/docs/ts/latest/guide/template-syntax.jade | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/public/docs/ts/latest/guide/template-syntax.jade b/public/docs/ts/latest/guide/template-syntax.jade index bc9bb7ec6c..08118f96c6 100644 --- a/public/docs/ts/latest/guide/template-syntax.jade +++ b/public/docs/ts/latest/guide/template-syntax.jade @@ -571,15 +571,14 @@ a(id="one-time-initialization") The following binding pairs do the same thing: +makeExample('template-syntax/ts/app/app.component.html', 'property-binding-vs-interpolation')(format=".") :marked - Interpolation is a convenient alternative for property binding in many cases. - In fact, Angular translates those interpolations into the corresponding property bindings - before rendering the view. + _Interpolation_ is a convenient alternative to _property binding_ in many cases. - 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 suggest establishing coding style rules and choosing the form that 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 #### Content security