Table Of ContentMobile App Development with Ionic 2
by Chris Griffith
Copyright © 2016 Christopher Griffith. All rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc. , 1005 Gravenstein Highway North, Sebastopol, CA 95472.
O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are
also available for most titles ( http://safaribooksonline.com ). For more information, contact our corporate/
institutional sales department: 800-998-9938 or corporate@oreilly.com .
Editor: Meg Foley Proofreader: FILL IN PROOFREADER
Production Editor: FILL IN PRODUCTION EDI‐ Indexer: FILL IN INDEXER
TOR Interior Designer: David Futato
Copyeditor: FILL IN COPYEDITOR Cover Designer: Karen Montgomery
Illustrator: Rebecca Demarest
January -4712: First Edition
Revision History for the First Edition
2016-10-25: First Early Release
See http://oreilly.com/catalog/errata.csp?isbn=9781491937716 for release details.
The O’Reilly logo is a registered trademark of O’Reilly Media, Inc. Mobile App Development with Ionic 2,
the cover image, and related trade dress are trademarks of O’Reilly Media, Inc.
While the publisher and the author(s) have used good faith efforts to ensure that the information and
instructions contained in this work are accurate, the publisher and the author(s) disclaim all responsibil‐
ity for errors or omissions, including without limitation responsibility for damages resulting from the use
of or reliance on this work. Use of the information and instructions contained in this work is at your own
risk. If any code samples or other technology this work contains or describes is subject to open source
licenses or the intellectual property rights of others, it is your responsibility to ensure that your use
thereof complies with such licenses and/or rights.
978-1-491-93771-6
[FILL IN]
Mobile App Development with
Ionic 2
Cross-Platform Apps with Ionic 2, Angular 2 and Cordova
by Chris Griffith
Boston
Who Should Read This Book
This book is for anyone who is looking to get started with the Ionic Framework. It is
expected that readers are comfortable with JavaScript, HTML and CSS before starting
this book. We will cover some key concepts of TypeScript, ES6, Angular 2, and
Apache Cordova, but you may want to have resources available on those topics as
well. We will take it step by step, so relax and get ready to learn how to build hybrid
mobile apps with Ionic, Angular, and Cordova.
Navigating This Book
This book aims to walk a developer through each part of Ionic, step by step. The book
is roughly organized as follows:
• Chapter 1, Hybrid Mobile Apps, is an introduction to the concept of hybrid
mobile applications.
• Chapter 2, Setting our development environment, covers what is needed to build
Ionic applications.
• Chapter 3, Understanding the Ionic Command Line Interface, digs into the CLI’s
functions.
• Chapter 4, Just enough Angular and TypeScript, introduces the basic concepts of
Angular and TypeScript.
• Chapter 5, Apache Cordova Basics, covers the foundations of Apache Cordova
and how it is used as part of the Ionic framework.
• Chapter 6, Understanding Ionic, provides an overview of what makes up an Ionic
page.
• Chapter 7, Building our Ionic 2 Do App, we create a Firebase-enabled To Do
application
• Chapter 8, Building a Tab-based App, using the tab template to create a National
Park explorer application with Google Map integration.
• Chapter 9, Building a Weather Application, build a sidemenu style application the
using the Forecast.io weather API and Google’s GeoCode API.
• Chapter 10, Debugging and Testing your application, covers some common tech‐
niques to resolve issues that can arise during development
• Chapter 11, Deploying your application, walks you through the steps needed to
submit your application to the app stores.
• Chapter 12, Exploring the Ionic Services, explores the additional services offered
by the Ionic platform.
• Chapter 13, Additional Resources, lists some curated references that can help any
Ionic developer.
• Appendix A, Understanding the config.xml fFile, covers the various attributes
that configure our application’s build process.
v
• Appendix B, Ionic Components, list each of the available Ionic components and
outlines their general use.
The entire code repository is hosted on GitHub, so if you don’t want to type in the
code examples from this book, or want to ensure that you are looking at the latest and
greatest code examples, do visit the repository and grab the contents.
If you have done Ionic 1 development, then you might just want to skim chapters 1
through 3. If you have experience with TypeScript and Angular 2, then feel free to
skip Chapter 4. For those who have used Apache Cordova or PhoneGap, then you can
bypass chapter 5.
Online Resources
The following resources are a great starting point for any Ionic developer, and should
be always available at your fingertips:
• The Official Ionic API documentation
• The Official Angular 2 documentation
• The Official Apache Cordova documentation
• The Ionic Worldwide Slack Channel
Conventions Used in This Book
The following typographical conventions are used in this book:
Italic
Indicates new terms, URLs, email addresses, filenames, and file extensions.
Constant width
Used for program listings, as well as within paragraphs to refer to program elements
such as variable or function names, databases, data types, environment variables,
statements, and keywords.
Constant width bold
Shows commands or other text t hat should be typed literally by the user.
Constant width italic
Shows text that should be replaced with user-supplied values or by values determined
by context.
vi |
Tip
This element signifies a tip or suggestion.
Note
This element signifies a general note.
Warning
This element indicates a warning or caution.
Using Code Examples
If you see the ↵ at the end of a code line, this indicates the line actually continues on
the next line.
Acknowledgments
To my lovely bride Anita, my twins Ben and Shira, and my good friend Leif Wells.
| vii
Description:Looking to build cross platform mobile applications? This hands-on guide provides a basic introduction and overview to the Ionic Framework, including some new services on the platform. You’ll learn a balanced approach to the mix of technologies—such as AngularJS, SASS, and Apache Cordova—that