I agree it's not user friendly as it used to be. after reading the docs I've managed to implement it.
First add your config to the environment. Than do the following:
app.module.ts
import { provideFirebaseApp, initializeApp } from '@angular/fire/app'; import { getFirestore, provideFirestore } from '@angular/fire/firestore'; import { environment } from '../environments/environment'; ... ... @NgModule({ declarations: [...], imports: [ ..., provideFirebaseApp(() => initializeApp(environment.firebase)), provideFirestore(() => getFirestore()), AngularFireModule.initializeApp(environment.firebase), ..., ], providers: [...], bootstrap: [...], })
someService.service.ts
import { AngularFirestore } from '@angular/fire/compat/firestore'; ... ... collection; constructor(private afs: AngularFirestore) { this.collection = afs.collection('some_collection'); } getCollection() { return this.collection.get(); }
Also make sure that when installing angular/fire the following files has been added to your project:
.firebaserc firebase.json
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I agree it's not user friendly as it used to be.
after reading the docs I've managed to implement it.
First add your config to the environment.
Than do the following:
Also make sure that when installing angular/fire the following files has been added to your project: