@stratiods/click-outside
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

SDS Components :: Angular Click Outside Directive

Directive emits event when clicking outside of the element where directive applies.

The $event emitted is undefined.

Compatibility

Angular >= v.8.2.10

Installation

Run npm install @stratiods/click-outside or

run yarn add @stratiods/click-outside.

Use

You need to import ClickOutsideModule into your module imports section.

Then use this way:

<div
  sdsClickOutside
  (clickOutside)="clickOutsideActionMethod()">
  Some content...
</div>

Inputs

@Input() apply: boolean = true;

You can dcide through this boolean input if directive works or not.

DEFAULT: true

 

@Input() exceptions: Array<string> = [];

Array composed by external DOM id's that by clicking on them, the clickOutside event is not emitted.

DEFAULT: []

Outputs

@Output() clickOutside: EventEmitter<undefined> = new EventEmitter();

Emits event when clicking outside of the element where directive applies.

Repo

https://github.com/stratio-design/sds-components/tree/master/projects/click-outside

/@stratiods/click-outside/

    Package Sidebar

    Install

    npm i @stratiods/click-outside

    Weekly Downloads

    1

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    27.3 kB

    Total Files

    18

    Last publish

    Collaborators

    • fgavilan-stratio
    • nulpas
    • lunaeme
    • mpastor-stratio