The structure of the application is having a single view (DynamicViewComponent
) that will hold different contentBlocks
on different routes.
So the problem I'm having trouble with is that when navigating from one route to another, previous instance of the DynamicViewComponent
is not destroyed. The application start to build up nodes and listeners with every navigation action.
The methods inside the DynamicViewComponent
are firing as many as navigation clicks were done.
I've tried to clear the ViewContainerRef
, but that only results in clearing stuff from the DOM, not the actual cached instances from previous routes.