-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I get the uid generated by Firebase? #1278
Comments
https://stackblitz.com/edit/angular-iqq9xo |
Thanks! But my elements' .$key gives me undefined. Am I doing this right? This is the code on my service to retrieve all records:
And this is my code on my component:
This is how I access them on my html: |
const id = this.afs.createId(); |
Thank you both! My code ended up like this:
|
Thank you for posting your code @EduardoIbarra. Helped big time. |
You can relate to the below example and generate your code Here "_email","_password","_city","_phone" are variables for onSaved: (value) => _email = value taken from TextFormField() function Code: String userId = await widget.auth.createUserWithEmailAndPassword(_email, _password); print('Registered user: $userId'); final new_user = await FirebaseFirestore.instance.collection('users').doc(userId). |
Version info
Angular: 4.4.5
Firebase:
AngularFire: angularfire2
This is not an issue, I just want to know how do I get to these kind of uid generated by Firebase? I'm trying to get a document, but since I don't have its id, I cannot reach it, also, I cannot query it, and if i use a collection to be able to query it, it just won't let me update or delete the record.
** Screenshots **
The text was updated successfully, but these errors were encountered: