I\'m planning to add a component dynamic to the DOM if show() is called. I know there is a solution with ngIf or [hidden] to hide it and use it as a directive, but I\'m not
UPDATE
Use ViewContainerRef.createComponent()
For a full example see Angular dynamic tabs with user-click chosen components
ORIGINAL
DynamicComponentLoader
was removed long ago
You can use DynamicComponentLoader for this purpose, but it's a bit cumbersome and has some issues related to bindings.
See also: