angularfire2

The official Angular library for Firebase.

Github星跟踪图

AngularFire

The official Angular library for Firebase

ng add @angular/fire@next

WARNING: Master branch is the work in progress for version 6 of AngularFire. You can find version 5 here, if you're looking for documentation or to contribute to stable. Learn more about the road toward version 6 here.


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 4kb with most under 2kb (gzipped).

Quickstart

Get your first application up and running by following our quickstart guide.

Example use:

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

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

Resources

Contributing

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

Upgrading to v6.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.

Developer Guide

NEW: Monitor usage of your application in production

AngularFireAnalytics provides a convient method of interacting with Google Analytics in your Angular application. The provided ScreenTrackingService and UserTrackingService automatically log events when you're using the Angular Router or Firebase Authentication respectively. Learn more about Google Analytics.

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

Receive push notifications

BETA: Change behavior and appearance of your application without deploying

Firebase Remote Config is a cloud service that lets you change the behavior and appearance of your app without requiring users to download an app update. Learn more about Remote Config.

NEW: Monitor your application performance in production

Firebase Performance Monitoring is a service that helps you to gain insight into the performance characteristics of your iOS, Android, and web apps. Learn more about Performance Monitoring.

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

主要指标

概览
名称与所有者angular/angularfire
主编程语言TypeScript
编程语言JavaScript (语言数: 5)
平台
许可证MIT License
所有者活动
创建于2016-01-11 20:47:23
推送于2025-06-03 18:17:52
最后一次提交
发布数139
最新版本名称20.0.0 (发布于 )
第一版名称2.0.0-alpha.1 (发布于 )
用户参与
星数7.8k
关注者数271
派生数2.2k
提交数1.1k
已启用问题?
问题数2537
打开的问题数273
拉请求数646
打开的拉请求数23
关闭的拉请求数311
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?