Hi,
I need to disable right click on <a> tag. Is there any way how to do this?
You can create new directive (in my case disable-right-click) and use following code:
HTML:
<a href="#" style="font-weight: normal;font-size: 11pt" ng-click="view()" **disable-right-click**>View Tag</a>
and JS code:
app.directive("disableRightClick", function () {
return {
restict: 'A',
link: function (scope, el) {
el.bind("contextmenu", function (e) {
e.preventDefault();
});
}
};
});
FavScripts.com is a free tool to save your favorite scripts and commands, then quickly find and copy-paste your commands with just few clicks.
Boost your productivity with FavScripts.com!