From http://www.sitepoint.com/creating-firebase-powered-end-end-ionic-application/