Skip to content
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

No longer need importProvidersFrom #3522

Merged
merged 1 commit into from
May 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading