Giter VIP home page Giter VIP logo

angular-off-click's Introduction

GitHub version npm version Bower version GitHub license angular-off-click

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

Installing

``` npm install angular-off-click --save ``` ```html <script src="node_modules/angular-off-click/dist/angular-off-click.js"></script> ```

-OR-

bower install angular-off-click --save
<script src="bower_components/angular-off-click/dist/angular-off-click.js"></script>

-THEN-

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-if attribute is an expression that will determine if the off-click should trigger or not.

The included off-click-filter directive allows you to pass a comma separated list of targets whose off-click will not be triggered when the element off-click-filter was applied to is clicked (gets parsed as javascript, so remember to wrap in single quotes). If you pass off-click-filter="'*'" that element will be a filter for every off-click on the page. The value is an angular expression and as such, you can also pass dynamic values like so: off-click-filter="'#' + myIdInScope" and off-click-filter="myScopedVar".

angular-off-click's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.