angular right click and context menu library. No external dependencies
npm install angular-right-clickng-right-click.js from src dir in the package to your project dirangular.module('yourApp',['ngRightClick',...]'); In your project dir, type the following command:
``sh`
$ bower install angular-right-click
Then add a
`
And finally in your Angular app, add the dependency as:
angular.module('yourApp',['ngRightClick',...]');
`sh`
$ npm install angular-right-clickrequire()
Then in your project source as:
`javascript`
require('angular-right-click')
file in your project index file as: `html
`Usage
$3
`html
`$3
In your html file, use the component like this:
`html
`$3
`html
`where the data format is (in your controller):
`javascript
$scope.sayHello = function(){
//say hello!
};$scope.menuItems = [
{ text: "Menu Item 1", //menu option text
disabled: true //No click event. Grayed out option.
},
{
text:"Menu Item 2",
callback: sayHello, //function to be called on click
disabled: false
}
];
`$3
I have included a default
css file for default styling. Include it in your file. You can easily override it with your custom css class lie that:`html
``Please check the examples directory to get the gist!
Check code example here.