From the course: Angular: Cloud-Powered Apps with Firebase
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Creating documents
From the course: Angular: Cloud-Powered Apps with Firebase
Creating documents
- [Instructor] Now that we have deployed our security rules we can start writing and updating data in a collection. We'll be creating our own user's collection in Cloud or Firestore, where users will update their profile data. The first thing we need to do is to import the Angular Firestore module, in our main angular module and add it to the imports. We will import AngularFirestoreModule, from angular/fire/firestore and then we add this module to the imports here. Heading back now to the login component, once the user successfully signs up, we'll create a document for that user and the user's collection. And then, route the new user to the profile page. Let's first inject a custom auth service that we have implemented in our app. Private auth and we import the auth service. After updating the user profile with a display name, we will call a method on this auth service. And we will call this create user document.…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.