angular/angularfire
소개
Angular + Firebase = ❤️
웹 및 앱 개발측정된 스타 증가
- in 24h
- +2
- in 7 days
- +1
- in 15 days
- +1
- in 1 month
- +1
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalAngularFire
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.
Testing - Unit test components and services that use AngularFire, with Vitest, Jest, or Karma.
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
|
Analytics
|
App Check
|
Authentication
|
Cloud Firestore
|
Cloud Functions
|
Cloud Messaging
|
Cloud Storage
|
Data Connect
|
Performance Monitoring
|
Realtime Database
|
Remote Config
|
관련 프로젝트 살펴보기
불러오는 중…