How can I select an element in a component template?

Technology CommunityCategory: AngularHow can I select an element in a component template?
VietMX Staff asked 3 years ago

You can get a handle to the DOM element via ElementRef by injecting it into your component’s constructor:

constructor(myElement: ElementRef) { ... }