@stratiods/on-dom-activity

SDS Components :: Angular On Dom Activity Directive

Usage no npm install needed!

<script type="module">
  import stratiodsOnDomActivity from 'https://cdn.skypack.dev/@stratiods/on-dom-activity';
</script>

README

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