how to Initialize the config dynamically?
- Vorherrschende Sprache
- TypeScript
- Sterne
- 7.8k
- Forks
- 2.2k
- Ø Merge
- 22 Std. 28 Min.
- Gemergte PRs (30 T.)
- 6
Beschreibung
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:
```ts
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
Beitragsleitfaden
Rechercherichtung
Beginne damit, das aktuelle app.config.ts-Setup mit dem angeforderten Initialisierungspunkt in app.component.ts zu vergleichen, wobei provideFirebaseApp, initializeApp, provideAnalytics und getAnalytics im Mittelpunkt stehen. Bestimme, ob die vorhandenen Einstiegspunkte eine verzögerte Konfiguration unterstützen, und definiere ein reproduzierbares Angular 17/Firebase 10-Verhalten, das bestätigt, dass die Konfiguration später initialisiert wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- angular, firebase, typescript
- Bereich
- developer-experience, frontend
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100