angular-off-click

WebJar for angular-off-click

License

License

MIT
Categories

Categories

Angular User Interface Web Frameworks CLI
GroupId

GroupId

org.webjars.bower
ArtifactId

ArtifactId

angular-off-click
Last Version

Last Version

0.0.7
Release Date

Release Date

Type

Type

jar
Description

Description

angular-off-click
WebJar for angular-off-click
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/TheSharpieOne/angular-off-click

Download angular-off-click

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bower/angular-off-click/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>angular-off-click</artifactId>
    <version>0.0.7</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/angular-off-click/
implementation 'org.webjars.bower:angular-off-click:0.0.7'
// https://jarcasting.com/artifacts/org.webjars.bower/angular-off-click/
implementation ("org.webjars.bower:angular-off-click:0.0.7")
'org.webjars.bower:angular-off-click:jar:0.0.7'
<dependency org="org.webjars.bower" name="angular-off-click" rev="0.0.7">
  <artifact name="angular-off-click" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='angular-off-click', version='0.0.7')
)
libraryDependencies += "org.webjars.bower" % "angular-off-click" % "0.0.7"
[org.webjars.bower/angular-off-click "0.0.7"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.bower : angular jar [0,)

Project Modules

There are no modules declared in this project.

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
<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 ).

<button id="nav-toggle" off-click-filter="'#slide-out-nav'" ng-click="showNav = !showNav">Show Navigation</button>
<div id="slide-out-nav" ng-show="showNav" off-click="showNav = false" off-click-if="showNav">
    ...
</div>

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".

Versions

Version
0.0.7