Skip to content

Angular library for listening global click event which is easy registered in any element.

License

Notifications You must be signed in to change notification settings

bill-min/ng-global-click

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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>

About

Angular library for listening global click event which is easy registered in any element.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published