Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to Initialize the config dynamically? #3565

Open
imalitavakoli opened this issue Sep 1, 2024 · 1 comment
Open

how to Initialize the config dynamically? #3565

imalitavakoli opened this issue Sep 1, 2024 · 1 comment

Comments

@imalitavakoli
Copy link

I'm looking for a simple way to initializeApp later inside of the app.component.ts NOT in my app.config.ts. I need to do this because of my current app implementation and requirements...

Currently, here's my app.config.ts file:

import { provideFirebaseApp, initializeApp } from '@angular/fire/app';
import { getAnalytics, provideAnalytics } from '@angular/fire/analytics';

export const appConfig: ApplicationConfig = {
  providers: [
    provideFirebaseApp(() =>
      initializeApp({
        apiKey: 'xxx',
        authDomain: 'xxx.firebaseapp.com',
        databaseURL: 'https://xxx.firebaseio.com',
        projectId: 'xxx',
        storageBucket: 'xxx',
        messagingSenderId: '123',
        appId: 'xxx',
        measurementId: 'xxx',
      }),
    ),
    provideAnalytics(() => getAnalytics()),
    ...
  ],
  ...
})

Any help is so appreciated ❤️

Version info

Angular: 17.3.3

Firebase: ^10.13.1

AngularFire: ^18.0.1

@google-oss-bot
Copy link

This issue does not seem to follow the issue template. Make sure you provide all the required information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants