Skip to content

tenphi/ng-click-outside

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ng-click-outside

An angular directive to bind an action for a click outside the element. Uses the service for single event listener on document and destructor on each element with directive to avoid memory leaks.

###Installation

Bower

$ bower install ng-click-outside --save

NPM

$ npm install ng-click-outside --save

###Usage

Basic example:

app.module('app', ['tenphi.clickOutside']);

webpack syntax

app.module('app', [require('ng-click-outside')]);

markup

<div class="dropdown" tnp-click-outside="open = false">
  <div class="dropdown-link" ng-click="open = !open"></div>
  <div class="dropdown-content" ng-show="open"></div>
</div>

About

An angular directive to bind an action for a click outside the element.

Resources

Stars

Watchers

Forks

Packages

No packages published