Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
A

angularfire

> 前端框架
Open source

Angular + Firebase = ❤️

7.8K stars0 likes0 views
WebsiteGitHub

About

Angular + Firebase = ❤️

AngularFire

AngularFire smooths over the rough edges an Angular developer might encounter when implementing the framework-agnostic Firebase JS SDK & aims to provide a more natural developer experience by conforming to Angular conventions.

ng add @angular/fire

  • Dependency injection - Provide and Inject Firebase services in your components.
  • Zone.js wrappers - Stable zones allow proper functionality of service workers, forms, SSR, and pre-rendering.
  • Observable based - Utilize RxJS rather than callbacks for real-time streams.
  • NgRx friendly API - Integrate with NgRx using AngularFire's action based APIs.
  • Lazy-loading - AngularFire dynamically imports much of Firebase, reducing the time to load your app.
  • Google Analytics - Zero-effort Angular Router awareness in Google Analytics.
  • Router Guards - Guard your Angular routes with built-in Firebase Authentication checks.

Example use

typescript
import { ApplicationConfig } from '@angular/core';
import { provideFirebaseApp, initializeApp } from '@angular/fire/app';
import { getFirestore, provideFirestore } from '@angular/fire/firestore';

export const appConfig: ApplicationConfig = {
  providers: [
    provideFirebaseApp(() => initializeApp({ /* ...your Firebase config... */ })),
    provideFirestore(() => getFirestore()),
    // ...
  ],
  // ...
}
typescript
import { AsyncPipe } from '@angular/common';
import { Component, inject } from '@angular/core';
import { Firestore, collectionData, collection } from '@angular/fire/firestore';

interface Item {
  name: string;
};

@Component({
  selector: 'app-root',
  template: `
  <ul>
    @for (item of (items$ | async); track item) {
      <li>
        {{ item.name }}
      </li>
    }
  </ul>
  `,
  imports: [AsyncPipe]
})
export class App {
  firestore = inject(Firestore);
  itemCollection = collection(this.firestore, 'items');
  items$ = collectionData<Item>(this.itemCollection);
}

Resources

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

Deploying SSR to App Hosting - Deploy a server-rendered app to Firebase App Hosting, and avoid the silent SSR-to-CSR fallback.

Contributing

Stackblitz Template - A runnable AngularFire example. Add your own Firebase configuration to connect it to your project.

Upgrading from v6.0? Check out our guide.

Upgrading from AngularFire 20? See the v21 upgrade guide.

Sample app

The sample folder contains a kitchen sink application that demonstrates use of the "modular" API, in a zoneless server-rendered application, with all the bells and whistles.

Having troubles?

Get help on our Q&A board, the official Firebase Mailing List, the Firebase Community Slack (#angularfire2), the Angular Community Discord (#firebase), Gitter, the Firebase subreddit, or Stack Overflow.

NOTE: Questions on the mailing list and issues filed here are answered on a best-effort basis by maintainers and other community members. If you are able to reproduce a problem with Firebase outside of AngularFire's implementation, please file an issue on the Firebase JS SDK or reach out to the personalized Firebase support channel.

Developer Guide

This developer guide assumes you're using the new tree-shakable AngularFire API, if you're looking for the compatibility API you can find the documentation here.

See the v7 upgrade guide for more information on this change..

Firebase product integrations

AI Logic

typescript
import { } from '@angular/fire/ai';

Analytics

typescript
import { } from '@angular/fire/analytics';

App Check

typescript
import { } from '@angular/fire/app-check';

Authentication

typescript
import { } from '@angular/fire/auth';

Cloud Firestore

typescript
import { } from '@angular/fire/firestore';

Cloud Functions

typescript
import { } from '@angular/fire/functions';

Cloud Messaging

typescript
import { } from '@angular/fire/messaging';

Cloud Storage

typescript
import { } from '@angular/fire/storage';

Data Connect

typescript
import { } from '@angular/fire/data-connect';

Performance Monitoring

typescript
import { } from '@angular/fire/performance';

Realtime Database

typescript
import { } from '@angular/fire/database';

Remote Config

typescript
import { } from '@angular/fire/remote-config';

Issues· 196 open

View all issuesOpen on GitHub
  • #3779

    `ng add @angular/fire@canary` installs the release candidate instead of the canary build

    Updated Oct 1, 2026
  • #3699

    What happened to @angular/fire v21?

    comp: build/pipelinetype: RFC / discussion / questionUpdated Sep 28, 2026
  • #3774

    docs: the App Check guide does not cover server-side rendering

    type: chorecomp: docscomp: app-checkcomp: ssrversion: current (v17+)Updated Sep 28, 2026
  • #3089

    AppCheck Error: reCAPTCHA placeholder element must be empty

    type: bugcomp: app-checkversion: legacy (v7-v16)Updated Sep 25, 2026
  • #3737

    Angular 22 release please

    Updated Sep 25, 2026
  • #3696

    Upgrade to Angular 22

    comp: build/pipelinetype: featureversion: current (v17+)Updated Sep 24, 2026
  • #3678

    Angular v21 support

    type: featurecomp: coretriaged: keep-openversion: current (v17+)Updated Sep 24, 2026
  • #3697

    Fix ng build warnings

    needs: more infocomp: otherUpdated Sep 24, 2026
  • #3757

    Use `TransferState` to hand server-rendered Firestore data to the browser, instead of reading every document twice

    type: featurecomp: firestorecomp: ssrpriority: P0 (critical)version: current (v17+)Updated Sep 2, 2026
  • #3755

    Six `firebase` entry points have no `@angular/fire` equivalent, so their exports are unreachable

    type: featurecomp: coreUpdated Aug 31, 2026

> Tags

TypeScriptangularangularfirecloud-firestorecloud-functions

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedOct 1, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架