Allow us to pass a factory of FirebaseAppConfig to AngularFireModule.initializeApp()
See original GitHub issueIt 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:
- Created 6 years ago
- Reactions:9
- Comments:11 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Does anyone have an example of how to “pass a factory of FirebaseAppConfig to AngularFireModule.initializeApp()” or alternative solution using runtime DI? Thanks.
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’sAPP_INITIALIZER
.