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 ...

Get Hybrid Mobile Development with Ionic now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.