firebase-thermite-ng
v2.0.4
Published
Firebase RxJS observables for Angular
Downloads
8
Maintainers
Readme
firebase-thermite-ng
What is it?
firebase-thermite-ng
contains the Angular modules for firebase-thermite
- a library of RxJS observables for Firebase.
Why might you need it?
You might need it if the official Angular library for Firebase - AngularFire2 - does not suit your requirements.
How does it differ from AngularFire2?
The differencees between firebase-thermite
and AngularFire2 are listed here.
In addition to those, firebase-thermite-ng
differs from AngularFire2 in that it ensures subscribers execute within the Angular zone. With AngularFire2, subscribers execute within the zone in which the observable was created.
Usage
import {
ThermiteAuthModule,
ThermiteDatabaseModule,
ThermiteModule
} from "firebase-thermite-ng";
@NgModule({
bootstrap: [
AppComponent
],
imports: [
...
ThermiteModule.initializeApp({
apiKey: "...",
authDomain: "...",
databaseURL: "...",
messagingSenderId: "...",
storageBucket: "..."
}),
ThermiteAuthModule,
ThermiteDatabaseModule
]
})
class AppModule {}
With the modules imported, ThermiteAuth
and ThermiteDatabase
are then available for injection into components, etc.
ThermiteAuth
implements firebase.auth.Auth
and ThermiteDatabase
implements firebase.database.Database
and both include additional methods that create observables. See auth/auth.ts
and database/database.ts
in firebase-thermite
.