Hello,
I try to get all docs from collection following by angular fire documentation.
private firestore = inject(Firestore)
ngOnInit() {
const collectionReference = collection(this.firestore, 'exercises')
collectionData(collectionReference).subscribe(console.log)
}
But get an error in console:
ERROR FirebaseError: Expected type 'Query', but it was: a custom wh object.
This is my firebase config:
importProvidersFrom([
provideFirebaseApp(() => initializeApp(environment.firebase)),
provideFirestore(() => {
const firestore = getFirestore()
if (environment.useEmulators) {
connectFirestoreEmulator(firestore, 'localhost', 8080)
}
return firestore
}),
provideAuth(() => {
const auth = getAuth()
if (environment.useEmulators) {
connectAuthEmulator(auth, 'http://localhost:9099', {
disableWarnings: true
})
}
return auth
}),
provideStorage(() => {
const storage = getStorage()
if (environment.useEmulators) {
connectStorageEmulator(storage, 'localhost', 9199)
}
return storage
})
]),
Thanks in advance