question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow us to pass a factory of FirebaseAppConfig to AngularFireModule.initializeApp()

See original GitHub issue

It would be great if we get an option to pass a factory function of FirebaseAppConfig to AngularFireModule.initializeApp(). In some cases such as using a webpack to get enviroment variables and AOT compiler it is impossible now to initialize AngularFireModule with correct config parameters. This is because of webpack does not run yet at the moment of module compilation. The ability to pass a factory of FirebaseAppConfig to static initialization function would be a solution for this and maybe other similar problems. One related issue already exists: https://github.com/angular/angularfire2/issues/1281

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:9
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

9reactions
brendonwmcommented, Jun 3, 2018

Does anyone have an example of how to “pass a factory of FirebaseAppConfig to AngularFireModule.initializeApp()” or alternative solution using runtime DI? Thanks.

5reactions
juristrcommented, Jan 28, 2018

Thinking of this, it would also be cool if we could get rid of the compile-time configuration and get the Firebase config at runtime, like via some call to a config JSON (I recently wrote an article on that).

The point is when I’m creating a CD pipeline I’d like to build once and then move that same package from testing, staging to production environment, without the need of rebuilding my Angular app again. That obviously doesn’t work when you use the Angular CLI environment.<env>.ts approach. Rather, I’d like to fetch it via a config using an approach like Angular’s APP_INITIALIZER.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Type error when trying to initialize app in angular firebase
ERROR: Type '{ ngModule: typeof AngularFireModule; providers: { provide: InjectionToken<string | FirebaseAppConfig>; useValue: string | ...
Read more >
@angular/fire | Yarn - Package Manager
This allows you to generate your HTML in a process called server-side rendering (SSR). AngularFire is compatible with server-side rendering; allowing you to ......
Read more >
How to use the angularfire2.AngularFireModule.initializeApp ...
To help you get started, we've selected a few angularfire2.AngularFireModule.initializeApp examples, based on popular ways it is used in public projects.
Read more >
How to pass Firebase database to use - to a library
import { AngularFireModule } from '@angular/fire'; ... It will allow you to connect to your Firebase instances with 1 easy click. Sent from...
Read more >
Initializing the Firebase dynamically in angular after getting ...
Import AngularFireModule from the '@angular/fire' package. ... In app.component.ts or any other component where you want to make an API call ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found