I've been utilizing the AngularFireList provided by @angular/fire/database to retrieve data from firestore. However, despite having data in the firestore, I am unable to fetch any information 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, which is an Observable
customerRef: AngularFireObject<any>; // Reference to Student object, also an Observable
// Injecting 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;
}}