How to set a default page?


#1

I’m developing an Ionic 3 PWA and I using the new Lazy Load and Page decorator.

If I access my app via https://www.mysite.com/my-app/#/home will get into home page. But if I access https://www.mysite.com/my-app/ I will get only the side menu. It’s because I not have a default “route” sice “route”.
config is in the Page decorator of each page.

How to set a default page in my app if it’s not set an URL segment in the link to open my app?


#2

I am using rootPage variable in app.compenent.ts to declare the root page.

I hope it helps. Here’s an example usage:

export class MyApp {
  //Since you are using lazy loading you have to use type of string for the rootPage
  rootPage:any = "HomePage";

#3

Thanks for reply.

Unfortunattely it’s not loading my home page.


#4

Solved! It was not working because I removed the main attribute from ion-nav.