diff --git a/integrations/modular/src/app/app.module.ts b/integrations/modular/src/app/app.module.ts index c5d1324..7a18c19 100644 --- a/integrations/modular/src/app/app.module.ts +++ b/integrations/modular/src/app/app.module.ts @@ -37,8 +37,6 @@ import { ServiceWorkerModule } from '@angular/service-worker'; { path: 'other', component: OtherComponent }, { path: '', redirectTo: '/list', pathMatch: 'full' } ]), - provideFirebaseApp(() => initializeApp(environment.firebase)), - provideFirestore(() => getFirestore()), NgxsModule.forRoot([RacesState, ClassificationsState, AttendeesState], { developmentMode: !environment.production }), @@ -61,7 +59,7 @@ import { ServiceWorkerModule } from '@angular/service-worker'; registrationStrategy: 'registerWhenStable:30000' }) ], - providers: [], + providers: [provideFirebaseApp(() => initializeApp(environment.firebase)), provideFirestore(() => getFirestore())], bootstrap: [AppComponent] }) export class AppModule {} diff --git a/integrations/standalone/src/app/app.config.ts b/integrations/standalone/src/app/app.config.ts index 8cd7df6..a82c75d 100644 --- a/integrations/standalone/src/app/app.config.ts +++ b/integrations/standalone/src/app/app.config.ts @@ -14,8 +14,6 @@ export const appConfig: ApplicationConfig = { providers: [ provideRouter(routes), importProvidersFrom( - provideFirebaseApp(() => initializeApp(environment.firebase)), - provideFirestore(() => getFirestore()), NgxsModule.forRoot([TestState], { developmentMode: !environment.production }), @@ -23,6 +21,8 @@ export const appConfig: ApplicationConfig = { disabled: environment.production }) ), + provideFirebaseApp(() => initializeApp(environment.firebase)), + provideFirestore(() => getFirestore()), provideNgxsFirestore({ developmentMode: true }) diff --git a/packages/firestore-plugin/src/lib/ngxs-firestore.state.spec.ts b/packages/firestore-plugin/src/lib/ngxs-firestore.state.spec.ts index 2f30274..4a5063b 100644 --- a/packages/firestore-plugin/src/lib/ngxs-firestore.state.spec.ts +++ b/packages/firestore-plugin/src/lib/ngxs-firestore.state.spec.ts @@ -2,13 +2,16 @@ import { TestBed } from '@angular/core/testing'; import { NgxsModule, Store } from '@ngxs/store'; import { NgxsFirestoreModule } from './ngxs-firestore.module'; import { ngxsFirestoreConnections } from './ngxs-firestore-connections.selector'; +import { initializeApp, provideFirebaseApp } from '@angular/fire/app'; +import { getFirestore, provideFirestore } from '@angular/fire/firestore'; describe('NGXS Firestore State', () => { let store: Store; beforeAll(() => { TestBed.configureTestingModule({ - imports: [NgxsModule.forRoot([]), NgxsFirestoreModule.forRoot()] + imports: [NgxsModule.forRoot([]), NgxsFirestoreModule.forRoot()], + providers: [provideFirebaseApp(() => initializeApp({})), provideFirestore(() => getFirestore())] }); store = TestBed.inject(Store);