docs(template-syntax): add "Table of Contents"

prototype for standard ToC across all docs.
closes #882
This commit is contained in:
Pascal Precht 2016-02-24 10:46:34 +01:00 committed by Ward Bell
parent f41517aca1
commit 561935629f
1 changed files with 11 additions and 6 deletions

View File

@ -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.
Lets find out what it takes to write a template for our view. Well cover these basic elements of template syntax:
Lets find out what it takes to write a template for our view. Well 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
<a id="elvis"></a>
### 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 (`?.`)** &mdash; perhaps better described as the "safe navigation operator" &mdash; 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=".")