How to disable Right Click, using Angular JS? – User friendly Tech help

nRequirement:- We need to disable Right Click on links in our Angular JS Application?
n
n

n

n

n

n

n

n

n

Context-Menu default behaviour

n

nSolution:-
n
We wrote a directive to override the default behaviour of “Context Menu”
n
nFurther we can use this directive to bind specific action on right click, using the contextmenu event.The contextmenu event fires when the user calls the context menu by right-clicking it .
n

n

n

n

n

n

n

n

n

n

nCode:-
n
nHTML:-

n

n

n

n

n

n

n

n

HTML code

n

Directive:-

n

n

n

n

n

n

n

n

Directive for disabling Context-Menu

n

nWorking Demo
n
nHope it helps our readers, please feel free to share your comments .

Was this article helpful?
YesNo

Similar Posts