From 561935629fcfa7d74be5a6444a52bb9ed2a470ef Mon Sep 17 00:00:00 2001 From: Pascal Precht Date: Wed, 24 Feb 2016 10:46:34 +0100 Subject: [PATCH] docs(template-syntax): add "Table of Contents" prototype for standard ToC across all docs. closes #882 --- .../docs/ts/latest/guide/template-syntax.jade | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/public/docs/ts/latest/guide/template-syntax.jade b/public/docs/ts/latest/guide/template-syntax.jade index 922d8cfc1b..463ba0b03a 100644 --- a/public/docs/ts/latest/guide/template-syntax.jade +++ b/public/docs/ts/latest/guide/template-syntax.jade @@ -6,7 +6,9 @@ include ../_util-fns Many of us are familiar with the component/template duality from our experience with model-view-controller (MVC) or model-view-viewmodel (MVVM). In Angular, the component plays the part of the controller/viewmodel, and the template represents the view. - Let’s find out what it takes to write a template for our view. We’ll cover these basic elements of template syntax: + Let’s find out what it takes to write a template for our view. We’ll cover these basic elements of template syntax. + + # Table Of Contents * [HTML](#html) * [Interpolation](#interpolation) @@ -27,11 +29,14 @@ include ../_util-fns * [Local template variables](#local-vars) * [Input and output properties](#inputs-outputs) * [Template expression operators](#expression-operators) + * [pipe](#pipe) + * ["elvis" (?.)](#elvis) // #enddocregion intro - -:marked - [Run the live example](/resources/live-examples/template-syntax/ts/plnkr.html) - +.l-sub-section + :marked + The [live example](/resources/live-examples/template-syntax/ts/plnkr.html) + demonstrates all of the syntax and code snippets described in this chapter. + // #docregion html-1 .l-main-section :marked @@ -1596,7 +1601,7 @@ figure.image-display ### The Elvis operator ( ?. ) and null property paths - The Angular **Elvis operator (`?.`)** is a fluent and convenient way to guard against null and undefined values in property paths. + The Angular **Elvis operator (`?.`)** — perhaps better described as the "safe navigation operator" — is a fluent and convenient way to guard against null and undefined values in property paths. Here it is, protecting against a view render failure if the `currentHero` is null. // #enddocregion expression-operators-elvis-1 +makeExample('template-syntax/ts/app/app.component.html', 'elvis-2')(format=".")