The core module
npm install @cresjie/angularfire2
The official library for Firebase and Angular
@cresjie/angularfire2@5.0.0-rc.7.4 has some bug fixes for angularfire2@5.0.0-rc.7 downward version, which also supports ionic 3 because of it still uses @angular/common@^5.0.0
app/app.module.ts.
#angularfire2 room), Gitter, or Stack Overflow.
bash
npm install firebase @cresjie/angularfire2 --save
`
Example use:
`ts
import { Component } from '@angular/core';
import { AngularFirestore } from 'angularfire2/firestore';
import { Observable } from 'rxjs/Observable';
@Component({
selector: 'app-root',
template:
})
export class MyApp {
items: Observable;
constructor(db: AngularFirestore) {
this.items = db.collection('items').valueChanges();
}
}
`
Developer Guide
$3
- Installation & Setup
$3
Firebase offers two cloud-based, client-accessible database solutions that support realtime data syncing. Learn about the differences between them in the Firebase Documentation.
#### Cloud Firestore
> AngularFirestore allows you to work with Cloud Firestore, the new flagship database for mobile app development. It improves on the successes of Realtime Database with a new, more intuitive data model. Cloud Firestore also features richer, faster queries and scales better than Realtime Database.
- Documents
- Collections
- Querying Collections
- Offline data
#### Realtime Database
> AngularFireDatabase` allows you to work with the Realtime Database, Firebase's original database. It's an efficient, low-latency solution for mobile apps that require synced states across clients in realtime.