Angular reuse component in another position in dom WITHOUT reinitialization
In our Angular (v11) application, we use some components multiple times in different places in DOM, and they are toggled in/out with ngIf’s. Mostly because of reponsive design decisions. Example:
… and in another position, probably within some other components:
When we switch our view, the default Angular behaviour in this case is, the tag is removed from dom from the position1, the component will be killed, the tag is added in other position2 in dom, and the component will be reinitialized again.
Can we somehow without any component change, reuse this component in another position in DOM?