Move component to another place using ember-maybe-in-element

I have a use case where I want to append child component say child-component to a different component dynamically.

<div class="container">
  <div class="content">
    <child-component></child-component>
   </div>
</div>

I am using in child-component.js file

const mainContainer = document.querySelector('.container .content');
const myElm = this.element.querySelector('[data-child-content]');
mainContainer.appendChild(myElm);

I want to use ember-maybe-in-element addon to achieve this appendChild.



Read more here: https://stackoverflow.com/questions/64397489/move-component-to-another-place-using-ember-maybe-in-element

Content Attribution

This content was originally published by Sankeerna Reddy at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: