1.0.1 • Published 4 years ago

@stratiods/on-dom-activity v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

SDS Components :: Angular On Dom Activity Directive

Directive emits event when component appears on DOM and emits other event when component goes from DOM.

The $event emitted is the DOM element (HTMLElement type) where the directive works.

Compatibility

Angular >= v.7.2.15

Installation

Run npm install @stratiods/on-dom-activity or

run yarn add @stratiods/on-dom-activity

Use

You need to import OnDomActivityModule into your module imports section.

Then use this way:

<div
  sdsOnDomActivity
  (comeToDom)="comeToDomActionMethod($event)"
  (goesFromDom)="goesFromDomActionMethod($event)">
  Some content...
</div>

Inputs

No inputs defined.

Outputs

@Output() comeToDom: EventEmitter<HTMLElement> = new EventEmitter();

Emits DOM element object when it appears on DOM.

 

@Output() goesFromDom: EventEmitter<HTMLElement> = new EventEmitter();

Emits DOM element object when it is destroyed from DOM.

Repo

https://github.com/stratio-design-system/sds-components/tree/master/projects/on-dom-activity