angular-click-outside

WebJar for angular-click-outside

Лицензия

Лицензия

ISC
Категории

Категории

IDE Инструменты разработки Angular Взаимодействие с пользователем Веб-фреймворки CLI
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

angular-click-outside
Последняя версия

Последняя версия

1.2.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

angular-click-outside
WebJar for angular-click-outside
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/twhitbeck/angular-click-outside

Скачать angular-click-outside

Как подключить последнюю версию

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

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

angular-click-outside

A simple angular 1.x directive to execute code when clicking outside of an element

Get it

npm install angular-click-outside --save

Use it

  • Include script in your html
<script src="node_modules/angular-click-outside/angular-click-outside.js"></script>
  • Add the tw.directives.clickOutside module to your module's list of dependencies:
angular.module('app', ['tw.directives.clickOutside'])
  • Use the twClickOutside directive.
<div class="menu" tw-click-outside="hideMenu()">
...
</div>

Ignoring the event

If you don't want the twClickOutside to fire under certain circumstances (e.g. you don't need to hide the menu if it's already hidden), use the ignoreIf attribute:

<button ng-click="showMenu()">Show Menu</button>
<div class="menu" tw-click-outside="hideMenu()" ignore-if="menuAlreadyHidden()">
...
</div>

Use this to:

  • avoid side effects of hideMenu()
  • avoid cost of hideMenu() if it is more expensive to run than menuAlreadyHidden()

Developing/testing

Use npm install && npm start to open the example in your browser with live reloading via browserSync

Версии библиотеки

Версия
1.2.0
1.1.1