/angular-off-click

Its like click, but when you don't click on your element.

Primary LanguageJavaScriptMIT LicenseMIT

angular-off-click

It's like click, but when you don't click on your element.

Installing

``` bower install angular-off-click --save ``` ```javascript angular('yourAngularApp',['offClick']); ```

Usage/Example

Here we have a slide out navigation div that will appear when the user clicks a button. We want the div to go away when they click off of it (`off-click`). We also want to make sure the button that triggers the div to open, also does initial close it (`off-click-filter`). ```html Show Navigation
...
```

The off-click attribute is the expression or function that will execute each time the user doesn't click on your element (or filter)
The optional off-click-filter attribute is a comma separated list of selectors that will not trigger off-click when they are clicked.
The optional off-click-if attribute is an expression that will determine if the off-click should trigger or not.

Other Features

Ability to choose elements outside of your element that will not trigger the `off-click` event.
Ability to pass an expression to determine of the `off-click` event should trigger.