Skip to Content
Mobile App Development with Ionic 2, 1st Edition
book

Mobile App Development with Ionic 2, 1st Edition

by Chris Griffith
April 2017
Intermediate to advanced content levelIntermediate to advanced
292 pages
6h 27m
English
O'Reilly Media, Inc.
Content preview from Mobile App Development with Ionic 2, 1st Edition

Chapter 8. Building a Tab-Based App

A very common type of application you might build is one that uses a tab-based navigation system. This design pattern works very well when you have a limited number (five or fewer) of groups (or tabs) of content. We are going to use this design pattern to create an app that will allow you to explore the various US national parks (in honor of them celebrating their centennial in 2016). Figure 8-1 shows what our final app will look like.

We are again going to use the Ionic CLI to scaffold our application. First, create a new directory that we will be building from. I named my directory IonicParks:

$ ionic start IonicParks --v2

Since we are going to be creating a tabs-based app, we did not need to pass in a template name, since the tab template is the default.

Next, change your working directory to the newly created IonicParks directory:

$ cd IonicParks
Figure 8-1. Ionic national parks app

Now let’s explore the template itself (Figure 8-2) before we get down to business:

$ ionic serve
Figure 8-2. Ionic tabs template

Not a lot here, but we can navigate between the three tabs (named Home, About, and Contact), and see the content change.

Taking a look inside the app.module.ts file, we see that instead of importing one page, we now are importing ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Ionic : Hybrid Mobile App Development

Ionic : Hybrid Mobile App Development

Rahat Khanna, Sani Yusuf, Hoc Phan

Publisher Resources

ISBN: 9781491937778Errata Page