@stratiods/on-dom-activity
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

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

Package Sidebar

Install

npm i @stratiods/on-dom-activity

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

80.8 kB

Total Files

24

Last publish

Collaborators

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