Fundamentals of Angular - Forms

Template Ref Variables


In this video...

You will learn about template ref variables, which are a way to get a handle to an element and use it in your templates and code.

Template Ref variables are created by adding an attribute to an element that starts with a hashtag, such as <a #myAnchor>click</a>. Once this is done you can reference the template ref variable by using the name of the attribute, with the hashtag, in your templates and code, such as binding to them, and passing them into event handlers.

To learn more about template ref variables, check out the official documentation.


I finished! On to the next chapter