Skip to content

Latest commit

 

History

History
30 lines (26 loc) · 879 Bytes

README.md

File metadata and controls

30 lines (26 loc) · 879 Bytes

Angular Global click event listener

It's easy to register an event listerner but not that much easy to trigger an event with clicking outside the box. Most usage is to close a popup, which is opened by clicking on a button, when clicking outside that button.

This library make it easier as you don't need to maintain any function to handle the event, just simply code expression within the element.

It registers touchstart for touch devices.

Demo: [Angular ng-global-click Demo](http://app.bill-min.com/ng-global-click/)

Usage: ``` angular.module('myApp', ['ngGlobalClick']) ```
//Normally you register the trigger in <body> element
<body global-click-trigger>
</body>

Register events that will happen when clicking outside of the element

<your-element on-global-click="expression"></your-element>