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
onauxclick
event ormousedown
for older browsers. - Easy to use! Auto detects angular global module on
html
orbody
tags. 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
a
tag to get the default behavior of open new tab when clicking with the middle button.
Installation
Install via bower
bower install ng-middle-click -S
Using
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
My link
Using it alone
My link
It will evaluate the same expression of
ng-click
Development
Install all the dependencies running the following commands:
npm installbower install
Commands
gulp
jslint, built, test, run server and open page/demo
gulp build
test, jslintgulp test
run tests oncegulp serve-test
run karma serve and execute them whensrc
ortest
files are changed
License
MIT