Struggling to retrieve element reference name? If anyone has a solution, please share it.
The alert message should resemble 'container', as that is the element reference.
Here is the code snippet in app.component.html:
<div (click)="test(event)" #container></div>
And here is the corresponding code in app.component.ts:
test(e){
alert(e.elementRef);
//Expected output: alert("container");
}