All Projects → arkon → Ng Click Outside

arkon / Ng Click Outside

Licence: mit
[Inactive] Angular directive for handling click events outside of an element.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Ng Click Outside

V Click Outside X
Vue V2 directive to react on clicks outside an element.
Stars: ✭ 91 (-57.87%)
Mutual labels:  directive
Ngx Joyride
Angular Joyride/Tour library
Stars: ✭ 135 (-37.5%)
Mutual labels:  directive
Ngx Daterangepicker Material
Pure Angular 2+ date range picker with material design theme, a demo here:
Stars: ✭ 169 (-21.76%)
Mutual labels:  directive
Angular Es6
Angular ES6 utility library. Write directives, controllers and services as ES6 classes.
Stars: ✭ 103 (-52.31%)
Mutual labels:  directive
Squirrel
squirrel-foundation is a State Machine library, which provided a lightweight, easy use, type safe and programmable state machine implementation for Java.
Stars: ✭ 1,789 (+728.24%)
Mutual labels:  event-handlers
Graphql Directive
Use custom directives in your GraphQL schema and queries 🎩
Stars: ✭ 142 (-34.26%)
Mutual labels:  directive
Agm Direction
This is the directive for @agm/core (not official)
Stars: ✭ 77 (-64.35%)
Mutual labels:  directive
Ng Inline Svg
[Inactive] Angular directive for inserting an SVG file inline within an element.
Stars: ✭ 211 (-2.31%)
Mutual labels:  directive
Vue.imagesloaded
Vue.js 2.0 directive to detect images loading
Stars: ✭ 134 (-37.96%)
Mutual labels:  directive
Ngx Currency
📦 Currency mask module for Angular
Stars: ✭ 161 (-25.46%)
Mutual labels:  directive
Ngx Digit Only
An Angular directive to only allow [0-9] in the input box when typing, pasting or drag/dropping.
Stars: ✭ 107 (-50.46%)
Mutual labels:  directive
3factor
3factor app is an architecture pattern for modern fullstack apps. 3factor apps are fast to build and are highly scalable.
Stars: ✭ 130 (-39.81%)
Mutual labels:  event-handlers
Vue Scrollto
Adds a directive that listens for click events and scrolls to elements.
Stars: ✭ 1,859 (+760.65%)
Mutual labels:  directive
Xer.cqrs
A lightweight and easy-to-use CQRS + DDD library
Stars: ✭ 96 (-55.56%)
Mutual labels:  event-handlers
Messagebus
A MessageBus (CommandBus, EventBus and QueryBus) implementation in PHP7
Stars: ✭ 178 (-17.59%)
Mutual labels:  event-handlers
V Dragged
Vue directive plugin for drag event detection.
Stars: ✭ 84 (-61.11%)
Mutual labels:  directive
Functional Promises
Write code like a story w/ a powerful Fluent (function chaining) API
Stars: ✭ 141 (-34.72%)
Mutual labels:  event-handlers
Go Trigger
A Global event triggerer for golang. Defines functions as event with id string. Trigger the event anywhere from your project.
Stars: ✭ 212 (-1.85%)
Mutual labels:  event-handlers
Cqrs
cqrs framework in go
Stars: ✭ 179 (-17.13%)
Mutual labels:  event-handlers
Vue Directive Tooltip
Vue.js tooltip directive. Easy to use, configure and style
Stars: ✭ 158 (-26.85%)
Mutual labels:  directive

ng-click-outside

⚠️ This package is not actively maintained. ⚠️


NPM

Demo

Formerly called ng2-click-outside

Angular directive for handling click events outside an element. Useful for things like reacting to clicking outside of a dropdown menu or modal dialog.

Like binding to a regular click event in a template, you can do something like this:

<div (clickOutside)="onClickedOutside($event)">My element</div>

Installation

npm install --save ng-click-outside

Usage

Add ClickOutsideModule to your list of module imports:

import { ClickOutsideModule } from 'ng-click-outside';

@NgModule({
  declarations: [AppComponent],
  imports: [BrowserModule, ClickOutsideModule],
  bootstrap: [AppComponent]
})
class AppModule {}

You can then use the directive in your templates:

@Component({
  selector: 'app',
  template: `
    <div (clickOutside)="onClickedOutside($event)">Click outside this</div>
  `
})
export class AppComponent {
  onClickedOutside(e: Event) {
    console.log('Clicked outside:', e);
  }
}

Options

Property name Type Default Description
attachOutsideOnClick boolean false By default, the outside click event handler is automatically attached. Explicitely setting this to true sets the handler after the element is clicked. The outside click event handler will then be removed after a click outside has occurred.
clickOutsideEnabled boolean true Enables directive.
clickOutsideEvents string 'click' A comma-separated list of events to cause the trigger. For example, for additional mobile support: [clickOutsideEvents]="'click,touchstart'".
delayClickOutsideInit boolean false Delays the initialization of the click outside handler. This may help for items that are conditionally shown (see issue #13).
emitOnBlur boolean false If enabled, emits an event when user clicks outside of applications' window while it's visible. Especially useful if page contains iframes.
exclude string A comma-separated string of DOM element queries to exclude when clicking outside of the element. For example: [exclude]="'button,.btn-primary'".
excludeBeforeClick boolean false By default, clickOutside registers excluded DOM elements on init. This property refreshes the list before the clickOutside event is triggered. This is useful for ensuring that excluded elements added to the DOM after init are excluded (e.g. ng2-bootstrap popover: this allows for clicking inside the .popover-content area if specified in exclude).
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].