O'Reilly logo

Hybrid Mobile Development with Ionic by Gaurav Saini

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CRUD operations

To read or write data from the database, we need an instance of database reference. Although we are using AngularFire so these functions are wrapped and we use the function provided by AngularFire library. Sometimes, we have to use low-level methods also like we will be doing later in the project. Let's now first start querying the foodItems to show that on our HomePage:

// src/pages/home/home.ts import { Component } from '@angular/core'; import { IonicPage, NavController, NavParams } from 'ionic-angular'; import { AngularFire, FirebaseListObservable }  from 'angularfire2'; import { CityProvider } from '../../providers/city/city' @IonicPage() @Component({   selector: 'page-home',   templateUrl: 'home.html', }) export class HomePage ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required