Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Ionic Cookbook

You're reading from   Ionic Cookbook Over 35 exciting recipes to spice up your application development with Ionic

Arrow left icon
Product type Paperback
Published in Oct 2015
Publisher Packt
ISBN-13 9781785287978
Length 264 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Hoc Phan Hoc Phan
Author Profile Icon Hoc Phan
Hoc Phan
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Creating Our First App with Ionic FREE CHAPTER 2. Managing States and Navigation 3. Adding Device Features Support 4. Offline Data Storage 5. Handling Gestures and Events 6. App Theme Customization 7. Extending Ionic with Your Own Components 8. User Registration and Authentication 9. Saving and Loading Data Using Firebase 10. Finalizing Your Apps for Different Platforms Index

Saving form data to Firebase

This recipe will cover another example of using Firebase as a persistent storage layer for your app. A very common use case that you will see in every app is the ability to have users fill out a form and save data to the server. Sometimes, there is more than one form in the entire process. A good example is a multistep shopping cart checkout app.

You will create an app that will:

  • Have three screens with a form per screen
  • Allow a user to either swipe or click on the Back and Next buttons to navigate horizontally to each screen
  • Let a user submit the form and save it to Firebase

Getting ready

You can close the previous app from your editor because this example will start with a brand new app.

How to do it...

Here are the steps:

  1. Let's start with a blank Ionic app (such as firebase-ionic-form) and include firebase-v2.2.4.js and angularfire-v1.1.1.min.js in the index.html header, as follows:
    $ ionic start firebase-ionic-form blank
    
  2. Structure the index.html file in such...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime