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

0.2.0 • Public • Published

Circe :: 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 @lunaeme/circe-on-dom-activity or

run yarn add @lunaeme/circe-on-dom-activity.

Use

You need to import OnDomActivityModule into your module imports section.

Then use this way:

<div
  ccOnDomActivity
  (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/nulpas/circe/tree/master/projects/on-dom-activity

Package Sidebar

Install

npm i @lunaeme/circe-on-dom-activity

Weekly Downloads

10

Version

0.2.0

License

MIT

Unpacked Size

82.7 kB

Total Files

24

Last publish

Collaborators

  • lunaeme