Skip to content

Commit 33e08b0

Browse files
committed
chore(doc): Document triggering context menu with other events
1 parent b00d4d0 commit 33e08b0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,18 @@ export class MyContextMenuClass {
146146
}
147147
```
148148

149+
## Triggering the Context Menu with a Different Event
150+
The context menu can be triggered at any point using the method above. For instance, to trigger the context menu
151+
with a left click instead of a right click, use this html:
152+
153+
```html
154+
<ul>
155+
<li *ngFor="item in items" (click)="onContextMenu($event, item)">Left Click: {{item.name}}</li>
156+
</ul>
157+
```
158+
159+
This could be `(keydown)`, `(mouseover)`, or `(myCustomEvent)` as well.
160+
149161
## Custom Styles
150162

151163
The html that is generated for the context menu looks like this:

0 commit comments

Comments
 (0)