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.
Displaying user data
From the course: Angular: Cloud-Powered Apps with Firebase
Displaying user data
- [Instructor] Now that we have written our user document, in our profile component let's display the newly created information. Heading over to Visual Studio Code, head over to the profile component. We will first need to import a couple of things. Import the AngularFirestoreDocument and also AngularFirestore from angular/fire/firestore. And I'm going to fix this typo here. We will also need to import Observable from RXJS. We will need both a reference to the document so let's create that now. Call this observable itemDoc and it will be of type AngularFirestoreDocument. The type will be the UserProfile type, which is a model that we previously created. We can go ahead and import that now. And the actual item will be an Observable of type UserProfile. Next, we will inject the AngularFirestore service. Public afs AngularFirestore. And then in the on knit hook we can get a reference to the document and the observable.…
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.