Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Angular right click and context menu library. No dependencies.

License

NotificationsYou must be signed in to change notification settings

zeeshanhyder/angular-right-click

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Angular right click and context menu library. No dependencies.

Installation

General

  • Copy/moveng-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 projecthtml:

<scriptsrc='/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

Thenrequire() in your project source as:

require('angular-right-click')

CSS

Import defaultcss file in your projectindex file as:

<linkrel="stylesheet"href="[node_modules | bower_components]/angular-right-click/src/css/ng-right-click.css">

Usage

Basic callback only (likeng-click, no context menu)

<divng-right-click="someFunction()"></div>

Context-menu only option

In your html file, use the component like this:

<divng-right-clickmenu-items="menuItems"></div>

Both callback and context-menu option

<divng-right-click="someFunction()"menu-items="menuItems"></div>

where the data format is (in your controller):

$scope.sayHello=function(){//say hello!};$scope.menuItems=[{text:"Menu Item 1",//menu option textdisabled:true//No click event. Grayed out option.},{text:"Menu Item 2",callback:sayHello,//function to be called on clickdisabled:false}];

Styling

I have included a defaultcss file for default styling. Include it in your file. You can easily override it with your customcss class lie that:

<divng-right-clickmenu-items="menuItems"menu-class="custom-css-class"></div>

Examples

Please check the examples directory to get the gist!

Check code examplehere.

About

Angular right click and context menu library. No dependencies.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp