How to get Element references in Angular templates?

Table of Content 1. Introduction 2. What is Angular ElementRef? 3. Getting started 4. Accessing Template Elements using ViewChild 5. Property of ElementRef 6. Using template reference variables with child components 7. How to use angular element references on a directive? 8. How to prevent XSS attack on ElementRef? 9. Conclusion Introduction Angular’s template reference variables give a useful API across which you can interconnect with DOM...

read more