Skip to content

Commit 4c48d85

Browse files
authored
Merge branch 'main' into fix-dataconnect-codegen-injection
2 parents 8b24f71 + 279d891 commit 4c48d85

18 files changed

Lines changed: 115 additions & 167 deletions

docs/analytics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ As a prerequisite, ensure that `AngularFire` has been added to your project via
1717
ng add @angular/fire
1818
```
1919

20-
Provide a Analytics instance in the application's `app.config.ts`:
20+
Provide an Analytics instance in the application's `app.config.ts`:
2121

2222
```ts
2323
import { provideFirebaseApp, initializeApp } from '@angular/fire/app';

docs/app-check.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ As a prerequisite, ensure that `AngularFire` has been added to your project via
1717
ng add @angular/fire
1818
```
1919

20-
Provide a App Check instance in the application's `app.config.ts`:
20+
Provide an App Check instance in the application's `app.config.ts`:
2121

2222
```ts
23-
import { provideFirebaseApp, initializeApp } from '@angular/fire/app';
23+
import { ApplicationConfig } from '@angular/core';
24+
import { provideFirebaseApp, initializeApp, getApp } from '@angular/fire/app';
2425
import { provideAppCheck, initializeAppCheck, ReCaptchaV3Provider } from '@angular/fire/app-check';
2526

2627
export const appConfig: ApplicationConfig = {
@@ -32,7 +33,7 @@ export const appConfig: ApplicationConfig = {
3233
...
3334
],
3435
...
35-
})
36+
}
3637
```
3738

3839
Next inject `AppCheck` it into your component:
@@ -54,4 +55,4 @@ AngularFire wraps the Firebase JS SDK to ensure proper functionality in Angular,
5455

5556
Update the imports from `import { ... } from 'firebase/app-check'` to `import { ... } from '@angular/fire/app-check'` and follow the official documentation.
5657

57-
[Getting Started](https://firebase.google.com/docs/app-check/web/recaptcha-enterprise-provider) | [API Reference](https://firebase.google.com/docs/reference/js/app-check)
58+
[Getting Started](https://firebase.google.com/docs/app-check/web/recaptcha-provider) | [API Reference](https://firebase.google.com/docs/reference/js/app-check)

docs/auth.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ As a prerequisite, ensure that `AngularFire` has been added to your project via
2020
ng add @angular/fire
2121
```
2222

23-
Provide a Auth instance in the application's `app.config.ts`:
23+
Provide an Auth instance in the application's `app.config.ts`:
2424

2525
```ts
26+
import { ApplicationConfig } from '@angular/core';
2627
import { provideFirebaseApp, initializeApp } from '@angular/fire/app';
2728
import { provideAuth, getAuth } from '@angular/fire/auth';
2829

@@ -33,7 +34,7 @@ export const appConfig: ApplicationConfig = {
3334
...
3435
],
3536
...
36-
})
37+
}
3738
```
3839

3940
Next inject `Auth` into your component:
@@ -171,8 +172,8 @@ export class UserComponent implements OnDestroy {
171172

172173
constructor() {
173174
this.idTokenSubscription = this.idToken$.subscribe((token: string | null) => {
174-
//handle idToken changes here. Note, that user will be null if there is no currently logged in user.
175-
console.log(string);
175+
//handle idToken changes here. Note, that token will be null if there is no currently logged in user.
176+
console.log(token);
176177
})
177178
}
178179

@@ -186,15 +187,18 @@ export class UserComponent implements OnDestroy {
186187
## Connecting the emulator suite
187188
188189
```ts
190+
import { ApplicationConfig } from '@angular/core';
191+
import { provideFirebaseApp, initializeApp } from '@angular/fire/app';
189192
import { connectAuthEmulator, getAuth, provideAuth } from '@angular/fire/auth';
190193

191-
@NgModule({
192-
imports: [
194+
export const appConfig: ApplicationConfig = {
195+
providers: [
196+
provideFirebaseApp(() => initializeApp({ ... })),
193197
provideAuth(() => {
194198
const auth = getAuth();
195199
connectAuthEmulator(auth, 'http://localhost:9099', { disableWarnings: true });
196200
return auth;
197201
}),
198202
]
199-
})
203+
}
200204
```

docs/compat.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# AngularFire
2-
The official [Angular](https://angular.io/) library for [Firebase](https://firebase.google.com/).
2+
The official [Angular](https://angular.dev/) library for [Firebase](https://firebase.google.com/).
33

44
<strong><pre>ng add @angular/fire</pre></strong>
55

docs/compat/auth/router-guards.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Route users with AngularFire guards
22

3-
`AngularFireAuthGuard` provides a prebuilt [`canActivate` Router Guard](https://angular.io/api/router/CanActivate) using `AngularFireAuth`. By default unauthenticated users are not permitted to navigate to protected routes:
3+
`AngularFireAuthGuard` provides a prebuilt [`canActivate` Router Guard](https://angular.dev/api/router/CanActivate) using `AngularFireAuth`. By default unauthenticated users are not permitted to navigate to protected routes:
44

55
> **NOTE**: [AngularFire has a new tree-shakable API](../../../README.md#developer-guide), you're looking at the documentation for the compatability version of the library. [See the v7 upgrade guide for more information on this change.](../../version-7-upgrade.md).
66

docs/database.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ ng add @angular/fire
2020
Provide a Database instance in the application's `app.config.ts`:
2121

2222
```ts
23+
import { ApplicationConfig } from '@angular/core';
2324
import { provideFirebaseApp, initializeApp } from '@angular/fire/app';
2425
import { provideDatabase, getDatabase } from '@angular/fire/database';
2526

@@ -30,7 +31,7 @@ export const appConfig: ApplicationConfig = {
3031
...
3132
],
3233
...
33-
})
34+
}
3435
```
3536

3637
Next inject `Database` into your component:
@@ -131,22 +132,26 @@ The `fromRef()` function creates an observable that emits reference changes.
131132
## Connecting to the emulator suite
132133

133134
```ts
135+
import { ApplicationConfig } from '@angular/core';
136+
import { provideFirebaseApp, initializeApp } from '@angular/fire/app';
134137
import { connectDatabaseEmulator, getDatabase, provideDatabase } from '@angular/fire/database';
135138

136-
@NgModule({
137-
imports: [
139+
export const appConfig: ApplicationConfig = {
140+
providers: [
141+
provideFirebaseApp(() => initializeApp({ ... })),
138142
provideDatabase(() => {
139143
const database = getDatabase();
140144
connectDatabaseEmulator(database, 'localhost', 9000);
141145
return database;
142146
}),
143147
]
144-
})
148+
}
145149
```
146150

147151
## Working with multiple instances
148152

149153
```ts
154+
import { ApplicationConfig } from '@angular/core';
150155
import { provideFirebaseApp, FirebaseApp, initializeApp } from '@angular/fire/app';
151156
import { getDatabase, provideDatabase } from '@angular/fire/database';
152157

@@ -156,14 +161,14 @@ const DATABASE_SHARD_URLS = [
156161
'https://BAZ.firebaseio.com',
157162
];
158163

159-
@NgModule({
160-
imports: [
161-
provideFirebaseApp(() => initializeApp(environment.firebase)),
164+
export const appConfig: ApplicationConfig = {
165+
providers: [
166+
provideFirebaseApp(() => initializeApp({ ... })),
162167
provideDatabase((app: FirebaseApp) => getDatabase(app, DATABASE_SHARD_URLS[0])),
163168
provideDatabase((app: FirebaseApp) => getDatabase(app, DATABASE_SHARD_URLS[1])),
164169
provideDatabase((app: FirebaseApp) => getDatabase(app, DATABASE_SHARD_URLS[2])),
165170
]
166-
})
171+
}
167172
```
168173

169174
```ts

docs/firebase.json

Lines changed: 0 additions & 16 deletions
This file was deleted.

docs/firestore.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ ng add @angular/fire
2121
Provide a Firestore instance in the application's `app.config.ts`:
2222

2323
```ts
24+
import { ApplicationConfig } from '@angular/core';
2425
import { provideFirebaseApp, initializeApp } from '@angular/fire/app';
2526
import { provideFirestore, getFirestore } from '@angular/fire/firestore';
2627

@@ -71,6 +72,7 @@ In `user-profile.component.ts`:
7172
```typescript
7273
import { Firestore, collection, collectionData} from '@angular/fire/firestore';
7374
import { Component, inject } from '@angular/core';
75+
import { Observable } from 'rxjs';
7476

7577
@Component ({
7678
selector: 'app-user-profile',
@@ -89,7 +91,7 @@ export class UserProfileComponent {
8991
this.users$ = collectionData(userProfileCollection) as Observable<UserProfile[]>;
9092
}
9193
}
92-
export Interface UserProfile {
94+
export interface UserProfile {
9395
username: string;
9496
}
9597
```
@@ -114,8 +116,9 @@ To write to Cloud Firestore use the `addDoc` function. It will create a new docu
114116

115117

116118
```typescript
117-
import { Firestore, collection, collectionData, addDoc} from '@angular/fire/firestore';
119+
import { Firestore, collection, collectionData, addDoc, CollectionReference, DocumentReference } from '@angular/fire/firestore';
118120
import { Component, inject } from '@angular/core';
121+
import { Observable } from 'rxjs';
119122

120123
@Component ({
121124
selector: 'app-user-profile',
@@ -137,7 +140,7 @@ export class UserProfileComponent {
137140
});
138141
}
139142
}
140-
export Interface UserProfile {
143+
export interface UserProfile {
141144
username: string;
142145
}
143146
```

docs/functions.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ ng add @angular/fire
2020
Provide a Cloud Functions instance in the application's `app.config.ts`:
2121

2222
```ts
23+
import { ApplicationConfig } from '@angular/core';
2324
import { provideFirebaseApp, initializeApp } from '@angular/fire/app';
2425
import { provideFunctions, getFunctions } from '@angular/fire/functions';
2526

@@ -30,7 +31,7 @@ export const appConfig: ApplicationConfig = {
3031
...
3132
],
3233
...
33-
})
34+
}
3435
```
3536

3637
Next inject `Functions` into your component:

docs/install-angular-cli-windows10.md

Lines changed: 0 additions & 82 deletions
This file was deleted.

0 commit comments

Comments
 (0)