0.0.1 • Published 8 years ago
ng-middle-click v0.0.1
ng-middle-click
A simple directive to watch middle button click event. Evaluates its own expression or from ng-click.
Features
- Evaluates it's own expression or get
ng-click's expression. - Prevents to execution when the tag has the disabled property activated.
- Listen
onauxclickevent ormousedownfor older browsers. - Easy to use! Auto detects angular global module on
htmlorbodytags. But to get this you must place the directive file after your angular init file. - Creates a module called
'ng-middle-click'when the conditions of the topic above aren't fulfilled.
Note
It' Should be used this directive on
atag to get the default behavior of open new tab when clicking with the middle button.
Installation
Install via bower
bower install ng-middle-click -SUsing
It will look for the ng-app attribute on the <html> or <body> tags to get your main module. If not found it'll create a module called ng-middle-click, so you have to inject it on your angular module.
Using with ng-click
<a href="#" ng-click="onClick($event)" ng-middle-click>My link</a>Using it alone
<a href="#" ng-middle-click="onMiddleClick($event)">My link</a>It will evaluate the same expression of
ng-click
Development
Install all the dependencies running the following commands:
npm install
bower installCommands
gulpjslint, built, test, run server and open page/demogulp buildtest, jslintgulp testrun tests oncegulp serve-testrun karma serve and execute them whensrcortestfiles are changed
License
MIT
0.0.1
8 years ago