Why constructor Called twice when refreshing the page?

#1

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

app.component.ts ------>


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

if the condition true the homepage will be set as root page when the first attempt it will load one time but, when we refreshing the page it will be load twice

how to prevent this ?
help me!

#2

Hi,

Have you got any solution for this.

Thanks