Chapter 3 - Add New Page

In the last chapter, we learned how to create a new Ionic application. In this chapter, we will learn how to add a new page to your Ionic application.

1. Add new page

Open command prompt/terminal at the directory where you want to create the app, then run:

1
$ ionic generate page "my-page"

After it is done, you should see a new folder called “my-page” under “my-app\src\app”.

2. Test the new page

Run the app using:

1
$ ionic serve

It will open up the browser. In the address bar, enter http://localhost:8100/my-page. Then you should be able to see your new page with a header “my-page” on it.


Next Chapter

In the next chapter, we will learn how to add navigation/routing for the pages.