Skip to content

Commit

Permalink
No longer need importProvidersFrom (#3522)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesdaniels authored May 14, 2024
1 parent 4d322f9 commit 1b92cb0
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions site/src/get-started/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ Beginning in [Angular v14](https://blog.angular.io/angular-v14-is-now-available-
The provider configuration for these applications should be added to the `bootstrapApplication` function in `main.ts`:

```ts
import { importProvidersFrom } from '@angular/core';
import { initializeApp, provideFirebaseApp } from '@angular/fire/app';
import { getAuth, provideAuth } from '@angular/fire/auth';
import { bootstrapApplication } from '@angular/platform-browser';
Expand All @@ -83,15 +82,11 @@ import { environment } from './environments/environment';

bootstrapApplication(AppComponent, {
providers: [
importProvidersFrom(
provideFirebaseApp(()=> initializeApp(environment.firebase))
),
provideFirebaseApp(()=> initializeApp(environment.firebase))
],
}).catch(err => console.error(err));
```

Note that you are required to wrap the `provideFirebaseApp` function call in the `importProvidersFrom` function.

### Configuring Firebase features

After adding the Firbase app providers, you also need to add providers for the each of Firebase features your application needs.
Expand Down Expand Up @@ -126,7 +121,6 @@ export class AppModule {}

```ts
// Standalone API based config (main.ts)
import { importProvidersFrom } from '@angular/core';
import { initializeApp, provideFirebaseApp } from '@angular/fire/app';
import { provideFirestore, getFirestore } from '@angular/fire/firestore'
import { getAuth, provideAuth } from '@angular/fire/auth';
Expand All @@ -137,11 +131,9 @@ import { environment } from './environments/environment';

bootstrapApplication(AppComponent, {
providers: [
importProvidersFrom(
provideFirebaseApp(() => initializeApp(environment.firebase)),
provideAuth(() => getAuth()),
provideFirestore(() => getFirestore())
),
provideFirebaseApp(() => initializeApp(environment.firebase)),
provideAuth(() => getAuth()),
provideFirestore(() => getFirestore())
],
}).catch(err => console.error(err));
```
Expand Down

0 comments on commit 1b92cb0

Please sign in to comment.