This repository was archived by the owner on Apr 4, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +17
-2
lines changed
Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 33 < Button text ="login anonymously " (tap) ="loginAnonymously() " class ="button button-user "> </ Button >
44 < Label text ="After pressing these buttons, check the console log " textWrap ="true "> </ Label >
55
6+ < Button text ="Issue 854 " (tap) ="issue854() " class ="button "> </ Button >
67 < Button text ="Add " (tap) ="firestoreAdd() " class ="button "> </ Button >
78 < Button text ="Set " (tap) ="firestoreSet() " class ="button "> </ Button >
89 < Button text ="Set (auto id) " (tap) ="firestoreSetByAutoID() " class ="button "> </ Button >
Original file line number Diff line number Diff line change @@ -26,9 +26,23 @@ export class FirestoreComponent {
2626 // AngularFireModule.initializeApp({});
2727 }
2828
29+ public issue854 ( ) : void {
30+ const helloRef : firestore . DocumentReference =
31+ firebase . firestore ( )
32+ . collection ( "users" )
33+ . doc ( firebase . auth ( ) . currentUser . uid )
34+ . collection ( "availability" )
35+ . doc ( "hello" ) ;
36+
37+ helloRef . get ( ) . then ( snapshot => console . log ( snapshot . data ( ) ) )
38+ }
39+
2940 public loginAnonymously ( ) : void {
3041 firebase . auth ( ) . signInAnonymously ( )
31- . then ( ( ) => console . log ( "Logged in" ) )
42+ . then ( ( ) => {
43+ const user = firebase . auth ( ) . currentUser ;
44+ firebase . firestore ( ) . collection ( "users" ) . doc ( user . uid ) . set ( user ) ;
45+ } )
3246 . catch ( err => console . log ( "Login error: " + JSON . stringify ( err ) ) ) ;
3347 }
3448
Original file line number Diff line number Diff line change 4343 "nativescript-dev-webpack" : " ^0.15.1" ,
4444 "typescript" : " ~2.7.2"
4545 }
46- }
46+ }
You can’t perform that action at this time.
0 commit comments