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 6. Understanding Ionic

Let’s now take a deeper look at what makes up the foundation of an Ionic page. Each Ionic page is formed from three base files: an HTML file which defines the components that are displayed; a Sass file which defines any custom visual styling for those components; and a TypeScript file which will provide the custom functions for those components. Since Ionic is built upon web technologies, we can use many of the same solutions that we might use in developing a traditional web application or web page (Figure 6-1).

Figure 6-1. Basic Ionic page structure

HTML Structure

Unlike in a traditional HTML file, you do not need to include the <head> tag and any elements like importing CSS files or other code libraries. You also do not include the <body> tag nor even the <!DOCTYPE html> or <html lang="en" dir="ltr"> tags. The contents of this HTML file are rendered within our application container, so we do not need them. We just define the actual components that will be shown to the user. These components are a mixture of traditional HTML tags, as well as custom tags that are used to define the Ionic components. Here is a sample of an Ionic page’s markup.

 <ion-header> <ion-navbar> <ion-title> Ionic Blank </ion-title> </ion-navbar> </ion-header> <ion-content padding> The world is your oyster. <p> If you get lost, the <a href="http://ionicframework.com/docs/v2">↵ ...
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