How to handle right click event in Angular app?

The event name is contextmenu. So, your html template code can be something like this:

<div (contextmenu)="onRightClick($event)"></div>

$event is an optional parameter so your template and event handler can look like this:

<div (contextmenu)="onRightClick()"></div>

onRightClick() {
    return false;
}

NOTE: You can return false; to avoid default browser action from the event.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)