0

I would like to have a html element on screen (may or may not be an anchor tag) with a click action to call a function using Angular 6. But the catch here is to get a context menu like an anchor tag does. Example like this:

enter image description here

I need the first three options. Others are of not much use.

I tried:

<a href (click)="someFunction()"> 
<a href="" (click)="someFunction()">
<a href="#" (click)="someFunction()">

Click event is not fired for the above ones

<a (click)="someFunction()">

This doesn't give the context menu the way I need

BraveNinja
  • 203
  • 3
  • 11
  • what do you mean by `context menu`? – brk Aug 31 '18 at 17:12
  • The menu you get when you right click. Briefly, the image that is posted in the question. – BraveNinja Aug 31 '18 at 17:13
  • maybe you do need to track the right-click event and build the menu yourself https://stackoverflow.com/questions/41670017/angular-2-right-click-events – hamilton.lima Aug 31 '18 at 17:19
  • Do you need the native element that you are selecting or you need the parent element (menu) ? – Abel Valdez Aug 31 '18 at 17:48
  • The context menu that comes by default it fine. I don't need the customized one. I just put the screenshot for reference. – BraveNinja Aug 31 '18 at 18:00
  • @AbelValdez: Parent element (menu). I mean the normal context menu that you get when you right click on any search result hyperlink from Google search results. – BraveNinja Aug 31 '18 at 18:06

0 Answers0