I cant't recive data from firestore with Angular

Discussão em 'Angular' iniciado por aouadi adib, Agosto 25, 2025.

  1. aouadi adib

    aouadi adib Guest

    I have used the AngularFireList from @angular/fire/database to get data from firestore while the firestore contains data and I can't get any data from it.

    import { Injectable } from '@angular/core';
    import { AngularFireDatabase, AngularFireList, AngularFireObject } from '@angular/fire/database';
    import { Customer } from '../shared/customer.model';

    @Injectable({
    providedIn: 'root'
    })
    export class CustomerService {

    customersRef: AngularFireList<any>; // Reference to Student data list, its an Observable
    customerRef: AngularFireObject<any>; // Reference to Student object, its an Observable too


    // Inject AngularFireDatabase Dependency in Constructor
    constructor(private db: AngularFireDatabase) { }

    getCustomersList() {
    this.customersRef = this.db.list('customers');
    return this.customersRef;
    }


    getCustomer(id: string) {
    this.customerRef = this.db.object('customers/' + id);
    return this.customerRef;
    }}


    [​IMG]

    Continue reading...

Compartilhe esta Página