0
Good afternoon. I have a Component that contains some child components, I have another component containing other child components. I want to reverse the children of one for the other, but I want the children to bring their events with them.
conceptual example:
<comp1>
<compfilhoa [prop1]="vary"(event)="eventa($event)">
</compfilhoa>
</comp1>
<comp2>
<compfilhob [propr2]="varx" (event)="eventb($event)">
</compfilhob>
</comp2>
I want to put at run time the compb inside the comp1 and compa inside the comp2. I want the compb and the compa to take all their characteristics and events. What library of Angular I need to use to do this?
Partner, for me it got a little fuzzy the idea of this there. Could you explain in form of business rule? Bringing more into the real world so we can better assimilate the idea?
– Leonardo Getulio
The components
comp1
andcomp2
are the same types? And thecompfilhoa
andcompfilhob
are the same types? If the answer is yes to both, I would suggest you change the object in yours. ts with each other, so the components would update in real time with the new data.– Leonardo Getulio
so... I’m making the component that would be comp 1 and 2.. I’m going to call swap-drag-drop, the idea is to drag one over the other and swap the content. I don’t know what components will be put inside them. Imagine that in one part of the screen there is a swap-drag-drop with 3 buttons and a table and in the other part I have a totally different table, when dragging one over the other, I will insert the contents. I did it using innerHTML, but then the methods stop working, if I have a button, it does nothing else
– Reginaldo Pedro de Lima