-
Notifications
You must be signed in to change notification settings - Fork 2.2k
how to Initialize the config dynamically? #3565
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
Comments
This issue does not seem to follow the issue template. Make sure you provide all the required information. |
Hi @imalitavakoli, below is one way I solved this problem:
In your app.module.ts (or equivalent configuration file), import Firebase with the default configuration. This makes Firebase available to your entire app without immediately loading all specific services.
Later—in your app.component.ts—you can import Firebase’s core functions and initialize (or get) the app again. Then, if you need to set up additional services (for example, a custom database configuration or other specifics), you can do so here.
Explanation in a Nutshell: This approach keeps your global configuration minimal and defers the specific setup (such as for the database) until it’s really needed, aligning with your app’s implementation and requirements. |
I'm looking for a simple way to
initializeApp
later inside of theapp.component.ts
NOT in myapp.config.ts
. I need to do this because of my current app implementation and requirements...Currently, here's my
app.config.ts
file:Any help is so appreciated ❤️
Version info
Angular: 17.3.3
Firebase: ^10.13.1
AngularFire: ^18.0.1
The text was updated successfully, but these errors were encountered: