Pages replacement


#1

how can I replace the default page of ionic project as example make page2 is a home page instead of page1 ???


#2

In app.component.ts:

export class AppComponent {

  public rootPage: any = 'Page2';

}

app.component.html:

<ion-nav [root]="rootPage" [class]="theme"></ion-nav>

#3

Really appreciate your help,but, I asked about ionic v1 there is no app.component.ts in it


#4

$urlRouterProvider.otherwise('/yourstateurl'); as part of your .config

Practically speaking, when run on devices, the state it shows depends on whether you cold start your app or resume your app (latter case - it shows where you left off), so I always have a handler that decides where to go on either resume or cold start (typically needed if your app needs session based auth)


#5

sorry for my newbie question but I don’t have enough info about ionic 1 can you please explain to me where to find .config in project because I search in my app about it but I don’t found and file with .config extension


#6

https://codepen.io/ionic/pen/QwamEW is one way to do it. The “.otherwise” part defines the entry page. Change that to another view and it will load up first.


#7

great, many thanks to you