Disable right click in Angular JS

$0
=
$0
+
$0
No specific Bitcoin Bounty has been announced by author. Still, anyone could send Bitcoin Tips to those who provide a good answer.
2

Hi,

I need to disable right click on <a> tag. Is there any way how to do this?

Tags:

2 answers - total earned - 4.7 mBTC ($1.25 USD)

2
=
1
=
$1.25
1 tip with total amount of 4.7 mBTC($1.25 USD) have been sent by alex

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();
            });
        }
    };
});
SEND BITCOIN TIPS

Thank You!

2

But it still RightClickable when you on Developer mode (CTRL+SHIFT+I)

SEND BITCOIN TIPS
0

Post Answer


Top 3 Tippers
Recent Tips

Will Bitcoin Tipping become a new Internet Culture?


Please share our story! THANK YOU!