K
K
Konstantin2020-02-21 21:29:23
JavaScript
Konstantin, 2020-02-21 21:29:23

Is it possible to listen to an event in a component and change the native element?

My component uses a pure JS class that creates DOM elements and returns them to the template by reference:

@ViewChild("layersContainer", { static: true }) layersContainer: ElementRef;
  <div class="Layers" #layersContainer></div>


That is, I pass the link ` #layersContainer` to the container to this class:

new DomBuilderJs(this.layersContainer);

Is it possible somehow in the component to listen for changes in the DOM tree built by a non-component?

More precisely, listen to the hover on a specific element and modify it already on the side of the component?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vann Damm, 2020-02-22
@effect_tw

See how to make a React useEffect in pure js

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question