docs: add template ref var to glossary (#36743)

There is not an entry in the glossary for template
reference variable. To clarify for site visitors,
we are adding one here.

PR Close #36743
This commit is contained in:
Kapunahele Wong
2020-06-09 14:33:02 -04:00
committed by Misko Hevery
parent 89a7ff3ada
commit e87a46be21
2 changed files with 20 additions and 0 deletions

View File

@ -939,6 +939,19 @@ A TypeScript-like syntax that Angular evaluates within a [data binding](#data-bi
Read about how to write template expressions in the [template expressions](guide/interpolation#template-expressions) section of the [Interpolation](guide/interpolation) guide.
{@a template-reference-variable}
## template reference variable
A variable defined in a template that references an instance associated with an element, such as a directive instance, component instance, template as in `TemplateRef`, or DOM element.
After declaring a template reference variable on an element in a template,
you can access values from that variable elsewhere within the same template.
The following example defines a template reference variable named `#phone`.
<code-example path="template-reference-variables/src/app/app.component.html" region="ref-var" header="src/app/app.component.html"></code-example>
For more information, see the [Template reference variable](guide/template-reference-variables) guide.
{@a token}
## token