An AngularJS directive to display a context menu when a right-click event is triggered
This project was built using ng-boilerplate!
Install using Bower:
bower install ng-context-menu --save
Include ng-context-menu.min.js in your app.
var app = angular.module('menu-demo', ['ngRoute', 'ng-context-menu'])
<div context-menu class="panel panel-default" data-target="myMenu"
ng-class="{ 'highlight': highlight, 'expanded' : expanded }">
...
</div>
Note: Make sure your dropdown menu has the css property position: fixed
If you need to disable the contextmenu in certain circumstances, you can add an expression to the
context-menu-disabled
attribute. If the expression evaluates to true, the contextmenu will be
disabled, for example, context-menu-disabled="1 === 1"
That's it, I hope you find this useful!
«–– Ian