I have this html element on my application:
.html
<a (click)="onOpen($event)">
<i class="fa fa-file-text-o"></i>
<p>Profile</p>
</a>
.ts
onOpen(event):void {
console.log( event.target );
}
When I click on the element I get different results for event.target
inside the function onOpen()
dependening on the position I click on.
For example, if I click ont he element where there is the p
text, the target is going to be the p
element instead of the a
element.
Is there a way to make it always be the element that has the click function?