A template variable is a reference to a DOM element, that we can directly declare from the template.
We use the sharp symbol ย "#" to declare a template variable.
In app.component.html:
๐Here we declare a variable '๐ง๐๐ฆ๐' that targets the '๐ข๐ง๐ฉ๐ฎ๐ญ' DOM element, since it is declared in that tag.
That way the '๐ง๐๐ฆ๐' variable references the '๐ข๐ง๐ฉ๐ฎ๐ญ' ย DOM element.
That's a template variable.
๐๐ฎ๐ญ ๐ฐ๐ก๐๐ญ ๐ข๐ฌ ๐ข๐ญ๐ฌ ๐ซ๐จ๐ฅ๐?
First, it allows to access the value of the element input elsewhere in your template by using this '๐ง๐๐ฆ๐' variable:
๐กYou can use this variable wherever you want in that component template html. But you can't use it in another template html file.
๐๐จ, ๐๐ง๐ ๐ฎ๐ฅ๐๐ซ ๐๐ฅ๐ฅ๐จ๐ฐ๐ฌ ๐ญ๐จ ๐ซ๐๐๐๐ซ๐๐ง๐๐ ๐ ๐๐๐ ๐๐ฅ๐๐ฆ๐๐ง๐ญ ๐๐ข๐ซ๐๐๐ญ๐ฅ๐ฒ ๐๐ซ๐จ๐ฆ ๐ ๐ญ๐๐ฆ๐ฉ๐ฅ๐๐ญ๐, ๐ญ๐ก๐๐ง๐ค๐ฌ ๐ญ๐จ ๐ญ๐๐ฆ๐ฉ๐ฅ๐๐ญ๐ ๐ฏ๐๐ซ๐ข๐๐๐ฅ๐.