I'm not sure what you had install to fetch data from FireBase but look at the code i assume that you used AngularFire.
You should follow this quick installation steps to set up the basic pattern to read a document as an Observable and use its data in a component template.
In your student-user.component.ts file:
users: Observable<any>;
constructor(private db: AngularFirestore) {
}
ngOnInit(){
this.users = db.collection('users').valueChanges();
}
In your HTML template, you unwrap the observable and use *ngFor directive to loop over users
and create elements base on the data provided:
<p *ngFor="let user of users | async"> {{user.userName}} </p>
Alternatively, you can subscribe to the Observable somewhere in your ts file to unwrap the data, but you should unsubscribe to it during ngOnDestroy()
to avoid memory leak
this.subscription = this.users.subscribe(console.log);
ngOnDestroy() {
this.subscription.unsubscribe();
}