Our application is setup so users navigating to a certain set of routes are lazy loaded like below:
{
path: path1,
component: Cmp1,
loadChildren: () => LazyLoadedModule,
}
We use a router link to navigate to one of these lazy loaded components like this...
<tile
routerLink="path1/{{name}}/achildpath"
[state]=someData>
...
</tile>
I notice when clicking on this tile the path + lazy loaded component attempts to load. The correct state is passed in initially. However, the component is destroyed immediately and then the component loads again with the state undefined! (loads without the state data but loads the correct component). The question is why is the component reloading and destroying itself on first render? Could this be a problem with the router outlet or the lazy loaded components? Our router outlet for the lazy loaded component is defined in Cmp1.