The official Angular library for Firebase.
Permalink
Failed to load latest commit information.
docs docs(functions): fix typo (#1891) Sep 22, 2018
src Bind messaging (#1889) Sep 21, 2018
test chore(): release @angular/fire 5.0 πŸŽ‰πŸ”₯πŸ•Ί (#1854) Sep 6, 2018
tools chore(): release @angular/fire 5.0 πŸŽ‰πŸ”₯πŸ•Ί (#1854) Sep 6, 2018
wrapper chore(): angularfire2 shim (#1864) Sep 11, 2018
.editorconfig fix(providers): make AoT compile friendly (#410) Aug 11, 2016
.gitignore chore(): angularfire2 shim (#1864) Sep 11, 2018
.npmignore fix(typings): add ambient zone typings Aug 9, 2017
.travis.yml feat(): support Angular and rxjs 6 (#1625) May 14, 2018
CHANGELOG.md Bind messaging (#1889) Sep 21, 2018
CONTRIBUTING.md docs(afs): AngularFire docs and more (#2) Oct 3, 2017
ISSUE_TEMPLATE.md chore(build): clean up package.json Aug 4, 2017
LICENSE chore: add license, readme, package Jan 11, 2016
PULL_REQUEST_TEMPLATE.md chore(): Update PR template with yarn Jan 23, 2018
README.md docs(universal): getting started, serving with Cloud Functions, and p… Sep 11, 2018
angularfire2.ts chore: rename main module from angularfire to angularfire2 Feb 12, 2016
karma-test-shim.js feat(packaging): add aot-friendly packaging Sep 16, 2016
karma.conf.js fix(): Switching over to `firebase` from `@firebase/*` (#1677) May 22, 2018
package.json Bind messaging (#1889) Sep 21, 2018
publish.sh chore(release): Release beta.7 Jan 13, 2017
yarn.lock chore(): release @angular/fire 5.0 πŸŽ‰πŸ”₯πŸ•Ί (#1854) Sep 6, 2018

README.md

AngularFire

The official library for Firebase and Angular

Build Status Join the chat at https://gitter.im/angular/angularfire2

What is AngularFire?

  • Observable based - Use the power of RxJS, Angular, and Firebase.
  • Realtime bindings - Synchronize data in realtime.
  • Authentication - Log users in with a variety of providers and monitor authentication state.
  • Offline Data - Store data offline automatically with AngularFirestore.
  • Server-side Render - Generate static HTML to boost perceived performance or create static sites.
  • ngrx friendly - Integrate with ngrx using AngularFire's action based APIs.
  • Manage binary data - Upload, download, and delete binary files like images, videos, and other blobs.
  • Call server code - Directly call serverless Cloud Functions with user context automatically passed.
  • Push notifications - Register and listen for push notifications
  • Modular - Include only what's needed. No AngularFire package is above 3kb with most under 2kb (gzipped).

Quick links

Contributing

Stackblitz Template - Remember to set your Firebase configuration in app/app.module.ts.

Upgrading to v5.0? Check out our guide.

Having troubles? Get help on the Firebase Mailing List (officially supported), the Firebase Community Slack (look for the #angularfire2 room), Gitter, or Stack Overflow.

Install

npm install firebase @angular/fire --save

Example use:

import { Component } from '@angular/core';
import { AngularFirestore } from '@angular/fire/firestore';
import { Observable } from 'rxjs';

@Component({
  selector: 'app-root',
  template: `
  <ul>
    <li *ngFor="let item of items | async">
      {{ item.name }}
    </li>
  </ul>
  `
})
export class MyApp {
  items: Observable<any[]>;
  constructor(db: AngularFirestore) {
    this.items = db.collection('items').valueChanges();
  }
}

Developer Guide

Getting started

Interacting with your database(s)

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.

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.

Authenticate users

Upload files

Send push notifications

Directly call Cloud Functions

Deploying your application

Firebase Hosting is production-grade web content hosting for developers. With Hosting, you can quickly and easily deploy web apps and static content to a global content delivery network (CDN) with a single command.

Server-side rendering

Angular Universal is a technology that allows you to run your Angular application on a server. This allows you to generate your HTML in a process called server-side rendering (SSR). Angularfire is compatible with server-side rendering; allowing you to take advantage of the Search Engine Optimization, link previews, the performance gains granted by the technology, and more. Learn more about Angular Universal.

Ionic