samedi 18 mai 2019

retriving the data from firebase into array

I need to display all the users that were created in the firebase

I tried to make a list of observable but it didn't show anything

export class UsersListComponent implements OnInit {
  users: Observable<any[]> ;

  constructor(db2: AngularFireDatabase) {
    this.users = db2.list('/users').valueChanges();

          }

and here is my HTML

<ul>
  <li *ngFor="let user of users | async">
     
  </li>
</ul>

I don't get anything shown on the screen here is my firebase structure

firebase structure




Aucun commentaire:

Enregistrer un commentaire