# Template variables
Template variables help you use data from one part of a template in another part of the template.
Use template variables to perform tasks such as respond to user input or finely tune your application's forms.
A template variable can refer to the following:
* A DOM element within a template
* A directive
* An element
* [TemplateRef](api/core/TemplateRef)
* A [web component](https://developer.mozilla.org/docs/Web/Web_Components "MDN: Web Components")
See the for a working example containing the code snippets in this guide.
## Syntax
In the template, you use the hash \(`#`\) character to declare a template variable.
The following template variable, `#phone`, declares a `phone` variable on an `` element.
Refer to a template variable anywhere in the component's template.
Here, a `