Lazy loading a rootPage calling the constructor twice

In component when we set the root page it will load twice. why its happening?

if (condition) {
rootpage = "Homepage";
rootpage = "LoginPage";

When I am reloading the page, It is calling the constructor in app.component.ts twice, once due to deep linking and once due to reloading.

how to prevent this ?
help me!


1 Like