angular-right-click
Angular right click and context menu library. No dependencies.
Installation
General
-
Copy/move
ng-right-click.js
fromsrc
dir in the package to your project dir -
In your Angular app, add a dependency to your module as below:
angular.module('yourApp',['ngRightClick',...]');
bower
In your project dir, type the following command:
$ bower install angular-right-click
Then add a <script>
in your project html
:
<script src='/bower_components/angular-right-click/src/ng-right-click.js'></script>
And finally in your Angular app, add the dependency as:
angular.module('yourApp',['ngRightClick',...]');
npm
In your project dir, run the following command:
$ npm install angular-right-click
Then require()
in your project source as:
CSS
Import default css
file in your project index
file as:
Usage
ng-click
, no context menu)
Basic callback only (like
Context-menu only option
In your html file, use the component like this:
Both callback and context-menu option
where the data format is (in your controller):
$scope{ //say hello!}; $scopemenuItems = 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 ;
Styling
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:
Examples
Please check the examples directory to get the gist!
Check code example here.