The point with the dynamic components is not to create them on Bülow, but creating them temporarily
based on some event and later probably remove them.
So in this example, it would be much more interesting to get the cold weather and building the component
in this case in after content in it.
I got all this cold and then move it to the show and time alert method.
That is the point where I really need this combined me remove this unnecessary console look first.
And now if I'm off to the browser, I can see how it works.
Fine.
I click play and then and the time I was shown.
Let me show you one thing.
If I inspect the code, I can see that the app simple alert people it is created below our with no usage
because it's an empty thip.
This is the thip where I've told Aguillard that the dynamic component has to be created.
And obviously in this case, this is not very efficient.
I would prefer the other to be created without the need of this extra dip.
There's another problem associated with this issue.
If I refresh the browser, you can see my tabs, the other arlott view, and here the useless empty
dip.
So this is already included into the dump, despite I have not created yet the dynamic component.
But don't worry.
Remember that for that kind of situations we can use the energy container element that is Gnangara directive.
That emulator does not, but in fact it's not rendered.
So let's give it a try.
I open up company and get the deal with Tamplin reference buyable alert and I replace it with an energy
container.
Now back to your browser up and inspector and see how there are the taps, the Abullah to be you and
there's no extra dip but an empty comment.
And if I click play when the come on and you can see how my dynamic component is created below and no
extra DB appears anywhere using any container, I have a tiff to insert the dynamic component into the
drum without an extra and the necessary element above it.
Of course there's another thing.
Let me press.
OK, restart and any the new content.
And by the end, guess what?
It has created the new Abimbola view below the previous one.
That is not shown because it's Bisbal property.
So to false.
So I'm having now two dynamic components because I've never destroyed the previous one.
However, I can solve it very easily.
To destroy a dynamic component, you only have to use the destroy method of the component 3F open up
component Dorte s and inside the on this means instead of console like some text, I can call this that
simple alad that destroy this way when I click the class button of my alad and is fired and when the
pan component that is subscribed, the text, the event, it destroys the dynamic component.
So back to browser I click play with and all the components and they are already shown again inspected
and thus my simple view.
But when I press the button, the component is destroyed and removed from the dom.
I can resod and start again and then ends and is created and added to the dome and it's destroyed again
on Claw's.
Let me summarize this.
I've moved the creation of the dynamic BAEO into the show and Taymor allat method.
So you can see that it really makes sense to create and destroy components on runtime.
The Method Destroy has been used to remove the component.
Also, I have converted the diff.
I used to inject my component into an energy container element so there's no extra element rendered
when the dynamic component does not exist.