docs(template-syntax): add "Table of Contents"
prototype for standard ToC across all docs. closes #882
This commit is contained in:
parent
f41517aca1
commit
561935629f
|
@ -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
|
|||
<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 (`?.`)** — 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=".")
|
||||
|
|
Loading…
Reference in New Issue