1
1
import { ApplicationRef , Component , NgZone } from '@angular/core' ;
2
2
import { FirebaseApp , FirebaseApps } from '@angular/fire/app' ;
3
3
import { Auth , AuthInstances , authState } from '@angular/fire/auth' ;
4
- import { Firestore , FirestoreInstances , getDoc , doc , DocumentSnapshot } from '@angular/fire/firestore/lite' ;
4
+ import { Firestore as FirestoreLite , FirestoreInstances as FirestoreLiteInstances , getDoc , doc , DocumentSnapshot } from '@angular/fire/firestore/lite' ;
5
+ import { Firestore , FirestoreInstances } from '@angular/fire/firestore' ;
5
6
import { DocumentData } from 'rxfire/firestore/lite/interfaces' ;
6
7
import { debounceTime , distinctUntilChanged } from 'rxjs/operators' ;
8
+ import { Storage , StorageInstances } from '@angular/fire/storage' ;
9
+ import { Messaging , MessagingInstances } from '@angular/fire/messaging' ;
10
+ import { RemoteConfig , RemoteConfigInstances } from '@angular/fire/remote-config' ;
11
+ import { Functions , FunctionsInstances } from '@angular/fire/functions' ;
12
+ import { Database , DatabaseInstances } from '@angular/fire/database' ;
13
+ import { Analytics , AnalyticsInstances } from '@angular/fire/analytics' ;
14
+ import { Performance , PerformanceInstances } from '@angular/fire/performance' ;
7
15
8
16
@Component ( {
9
17
selector : 'app-root' ,
@@ -17,19 +25,42 @@ export class AppComponent {
17
25
myDocData : Promise < DocumentSnapshot < DocumentData > > ;
18
26
title = 'sample' ;
19
27
constructor (
20
- public app : FirebaseApp , // default Firebase App
21
- public auth : Auth , // default Firbase Auth
22
- public apps : FirebaseApps , // all initialized App instances
23
- public authInstances : AuthInstances , // all initialized Auth instances
24
- public firestore : Firestore ,
25
- public firestoreInstances : FirestoreInstances ,
28
+ app : FirebaseApp , // default Firebase App
29
+ auth : Auth , // default Firbase Auth
30
+ apps : FirebaseApps , // all initialized App instances
31
+ authInstances : AuthInstances , // all initialized Auth instances
32
+ firestoreLite : FirestoreLite ,
33
+ firestoreLiteInstances : FirestoreLiteInstances ,
34
+ firestore : Firestore ,
35
+ firestoreInstances : FirestoreInstances ,
36
+ storage : Storage ,
37
+ storageInstances : StorageInstances ,
38
+ messaging : Messaging ,
39
+ messagingInstances : MessagingInstances ,
40
+ remoteConfig : RemoteConfig ,
41
+ remoteConfigInstances : RemoteConfigInstances ,
42
+ functions : Functions ,
43
+ functionsInstances : FunctionsInstances ,
44
+ database : Database ,
45
+ databaseInstances : DatabaseInstances ,
46
+ analytics : Analytics ,
47
+ analyticsInstances : AnalyticsInstances ,
48
+ performance : Performance ,
49
+ performanceInstances : PerformanceInstances ,
26
50
appRef : ApplicationRef ,
27
51
zone : NgZone ,
28
52
) {
29
- console . log ( { app, auth, apps, authInstances, firestore, firestoreInstances } ) ;
53
+ console . log ( {
54
+ app, auth, apps, authInstances, firestore, firestoreInstances,
55
+ firestoreLite, firestoreLiteInstances, storage, storageInstances,
56
+ messaging, messagingInstances, performance, performanceInstances,
57
+ analytics, analyticsInstances, functions, functionsInstances, database,
58
+ databaseInstances, remoteConfig, remoteConfigInstances
59
+ } ) ;
30
60
authState ( auth ) . subscribe ( it => console . log ( 'authState' , it ) ) ;
31
61
appRef . isStable . pipe ( distinctUntilChanged ( ) ) . subscribe ( it => console . log ( 'isStable' , it ) ) ;
32
- this . myDocData = getDoc ( doc ( firestore , 'animals/NJdGQCv1P92SWsp4nSE7' ) ) ;
62
+ this . myDocData = getDoc ( doc ( firestoreLite , 'animals/NJdGQCv1P92SWsp4nSE7' ) ) ;
63
+ console . log ( ( app as any ) . container ) ;
33
64
// firestoreInstance$.subscribe(it => console.log('$', it));
34
65
// initializeFirestore$.subscribe(it => console.log('init', it));
35
66
}
0 commit comments