GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - angular/angularfire: Angular + Firebase = ❤️

BranchesTags
Open more actions menu

Latest commit

 

History

1,148 Commits
1,148 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
docs
docs
 
 
sample
sample
 
 
site
site
 
 
src
src
 
 
test
test
 
 
tools
tools
 
 
.editorconfig
.editorconfig
 
 
.firebaserc
.firebaserc
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.npmignore
.npmignore
 
 
.nvmrc
.nvmrc
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
ISSUE_TEMPLATE.md
ISSUE_TEMPLATE.md
 
 
LICENSE
LICENSE
 
 
PULL_REQUEST_TEMPLATE.md
PULL_REQUEST_TEMPLATE.md
 
 
README.md
README.md
 
 
SECURITY.md
SECURITY.md
 
 
angular.json
angular.json
 
 
eslint.config.js
eslint.config.js
 
 
firebase.json
firebase.json
 
 
karma.conf.js
karma.conf.js
 
 
mise.toml
mise.toml
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
tsconfig.base.json
tsconfig.base.json
 
 
tsconfig.build.json
tsconfig.build.json
 
 
tsconfig.jasmine.json
tsconfig.jasmine.json
 
 
tsconfig.json
tsconfig.json
 
 
tsconfig.spec.json
tsconfig.spec.json
 
 
typedoc.json
typedoc.json
 
 

Repository files navigation

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

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()),
    // ...
  ],
  // ...
}
import { AsyncPipe } from '@angular/common';
import { Component, inject } from '@angular/core';
import { Firestore, FirestoreDataConverter, collectionData, collection } from '@angular/fire/firestore';

interface Item {
  name: string;
}

// Types the collection and checks every document on its way in
const itemConverter: FirestoreDataConverter<Item> = {
  toFirestore: item => item,
  fromFirestore: (snapshot, options) => {
    const data = snapshot.data(options);
    return { name: typeof data['name'] === 'string' ? data['name'] : '' };
  },
};

@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').withConverter(itemConverter);
  items$ = collectionData(this.itemCollection); // Observable<Item[]>
}

The converter is what gives the read its type. collection() alone returns an untyped reference. See Typed reads.

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.

Upgrading from AngularFire 21? See the v22 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

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

Analytics

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

App Check

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

Authentication

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

Cloud Firestore

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

Cloud Functions

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

Cloud Messaging

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

Cloud Storage

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

Data Connect

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

Performance Monitoring

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

Realtime Database

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

Remote Config

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

About

Angular + Firebase = ❤️

firebaseopensource.com/projects/angular/angularfire2

Topics

angularangularfirecloud-firestorecloud-functionsfirebasengrxnotificationsoffline-datarealtimerealtime-databaserxjs

Resources

Readme
MIT license

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy
Activity
Custom properties

Stars

7.8k stars

Watchers

254 watching

Forks

2.1k forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.