Basically I have a custom context menu component and I want it to show when a user right clicks in a certain component.
I have implemented the basic functionality, passing the ElementRef
to the context menu and adding an custom event handler to handle showing the context menu next to the cursor.
I can see that the event is being fired and the normal browser context menu is not opening due to $event.preventDefault()
, but my context menu is not showing up as expected. The boolean should be set so that the *ngIf
in the template evaluates to true
.
Direct public accessors to the properties have brought me to the same result.
Here is a stackblitz with the implementation
See Question&Answers more detail:os