The HomePage is the default root page in the Ionic 2 framework application. However, you can set your desired page as default root page in the Ionic 2 framework application.

When creating the new Ionic2 blank project, the HomePage will be created and set as the default page whenever the application is opened. The default root page configuration is in the app.component.ts file. You have to import the newly created page to this file and change the page as default root page.

In this tutorial, you will learn, how to change the default root page in the Ionic 2 framework. Let's see, how to do this from scratch using the Ionic 2 framework.

Create a new Ionic 2 project using the below command.

ionic start moon blank --v2

By default, the HomePage will be created. So create another page using the below command on your terminal.

ionic g page Login

Now the Login page is created. Delete the login.module.ts file. The login.module.ts file is not required.

And remove the below code from the login.ts file

@IonicPage()

Now import the Login page to the app.module.ts file

import { Login } from '../pages/login/login';

And include the newly created page to declarations and entryComponents.

@NgModule({
declarations: [
MyApp,
HomePage,Login
],
imports: [
BrowserModule,
IonicModule.forRoot(MyApp),
HttpModule
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
HomePage,Login
]

Then import the newly created page to the app.component.ts file.

import { Login } from '../pages/login/login';

Now change the HomePage to Login to the rootPage variable.

rootPage:any = Login;

That's all. You changed the default root page from HomePage to Login. Now it will show the Login as the default page whenever the Ionic 2 application is opened.

Below is the Ionic 2 information while writing this tutorial.

Cordova CLI: 6.5.0 
Ionic Framework Version: 3.1.1
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.3.7
ios-deploy version: Not installed
ios-sim version: 5.0.13 
OS: macOS Sierra
Node Version: v6.10.0
Xcode version: Xcode 8.2.1