Lazy loading a rootPage calling the constructor twice

#1

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

if (condition) {
rootpage = "Homepage";
}
else{
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!

Thanks

1 Like