@angular/fire 7.6.1 → 16.0.0-canary.596e208
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/analytics/is-analytics-supported-factory.d.ts +4 -0
- package/app-check/app-check.d.ts +0 -6
- package/app-check/app-check.module.d.ts +0 -1
- package/app-check/public_api.d.ts +2 -1
- package/auth-guard/auth-guard.d.ts +4 -4
- package/compat/auth/auth.d.ts +1 -1
- package/compat/auth-guard/auth-guard.d.ts +6 -4
- package/compat/database/interfaces.d.ts +12 -12
- package/compat/firestore/interfaces.d.ts +17 -17
- package/compat/proxy.d.ts +8 -8
- package/compat/remote-config/interfaces.d.ts +1 -1
- package/compat/storage/interfaces.d.ts +8 -8
- package/compat/storage/pipes/storageUrl.pipe.d.ts +1 -1
- package/core.d.ts +8 -12
- package/esm2022/analytics/analytics.module.mjs +94 -0
- package/esm2022/analytics/is-analytics-supported-factory.mjs +16 -0
- package/esm2022/analytics/overrides.mjs +3 -0
- package/esm2022/analytics/screen-tracking.service.mjs +147 -0
- package/esm2022/analytics/user-tracking.service.mjs +44 -0
- package/esm2022/app/app.module.mjs +84 -0
- package/esm2022/app-check/app-check.mjs +10 -0
- package/esm2022/app-check/app-check.module.mjs +79 -0
- package/esm2022/app-check/public_api.mjs +5 -0
- package/esm2022/auth/auth.module.mjs +71 -0
- package/esm2022/auth-guard/auth-guard.mjs +51 -0
- package/{esm2015/auth-guard/auth-guard.module.js → esm2022/auth-guard/auth-guard.module.mjs} +5 -5
- package/esm2022/compat/analytics/analytics.mjs +161 -0
- package/{esm2015/compat/analytics/analytics.module.js → esm2022/compat/analytics/analytics.module.mjs} +5 -5
- package/esm2022/compat/analytics/screen-tracking.service.mjs +49 -0
- package/esm2022/compat/analytics/user-tracking.service.mjs +53 -0
- package/esm2022/compat/auth/auth.mjs +161 -0
- package/{esm2015/compat/auth/auth.module.js → esm2022/compat/auth/auth.module.mjs} +5 -5
- package/{esm2015/compat/auth/public_api.js → esm2022/compat/auth/public_api.mjs} +1 -1
- package/esm2022/compat/auth-guard/auth-guard.mjs +51 -0
- package/{esm2015/compat/auth-guard/auth-guard.module.js → esm2022/compat/auth-guard/auth-guard.module.mjs} +5 -5
- package/{esm2015/compat/cache.js → esm2022/compat/cache.mjs} +3 -3
- package/esm2022/compat/database/database.mjs +119 -0
- package/{esm2015/compat/database/database.module.js → esm2022/compat/database/database.module.mjs} +5 -5
- package/esm2022/compat/database/list/create-reference.mjs +44 -0
- package/{esm2015/compat/firebase.app.module.js → esm2022/compat/firebase.app.module.mjs} +11 -11
- package/esm2022/compat/firestore/collection/changes.mjs +108 -0
- package/esm2022/compat/firestore/collection/collection.mjs +123 -0
- package/esm2022/compat/firestore/collection-group/collection-group.mjs +86 -0
- package/esm2022/compat/firestore/document/document.mjs +87 -0
- package/esm2022/compat/firestore/firestore.mjs +257 -0
- package/{esm2015/compat/firestore/firestore.module.js → esm2022/compat/firestore/firestore.module.mjs} +5 -5
- package/esm2022/compat/firestore/interfaces.mjs +2 -0
- package/esm2022/compat/firestore/observable/fromRef.mjs +40 -0
- package/esm2022/compat/functions/functions.mjs +69 -0
- package/{esm2015/compat/functions/functions.module.js → esm2022/compat/functions/functions.module.mjs} +5 -5
- package/{esm2015/compat/functions/public_api.js → esm2022/compat/functions/public_api.mjs} +1 -1
- package/esm2022/compat/messaging/messaging.mjs +80 -0
- package/{esm2015/compat/messaging/messaging.module.js → esm2022/compat/messaging/messaging.module.mjs} +5 -5
- package/{esm2015/compat/performance/performance.js → esm2022/compat/performance/performance.mjs} +7 -6
- package/{esm2015/compat/performance/performance.module.js → esm2022/compat/performance/performance.module.mjs} +5 -5
- package/esm2022/compat/performance/performance.service.mjs +27 -0
- package/esm2022/compat/proxy.mjs +59 -0
- package/esm2022/compat/remote-config/remote-config.mjs +207 -0
- package/{esm2015/compat/remote-config/remote-config.module.js → esm2022/compat/remote-config/remote-config.module.mjs} +5 -5
- package/esm2022/compat/storage/pipes/storageUrl.pipe.mjs +58 -0
- package/esm2022/compat/storage/storage.mjs +95 -0
- package/{esm2015/compat/storage/storage.module.js → esm2022/compat/storage/storage.module.mjs} +5 -5
- package/esm2022/core.mjs +45 -0
- package/esm2022/database/database.module.mjs +74 -0
- package/esm2022/firestore/firestore.module.mjs +74 -0
- package/esm2022/firestore/lite/lite.module.mjs +73 -0
- package/esm2022/firestore/rxfire.mjs +15 -0
- package/esm2022/functions/functions.module.mjs +74 -0
- package/esm2022/messaging/is-messaging-supported-factory.mjs +16 -0
- package/esm2022/messaging/messaging.module.mjs +86 -0
- package/esm2022/messaging/overrides.mjs +3 -0
- package/{esm2015/performance/performance.module.js → esm2022/performance/performance.module.mjs} +8 -8
- package/esm2022/remote-config/is-remote-config-supported-factory.mjs +16 -0
- package/esm2022/remote-config/overrides.mjs +3 -0
- package/esm2022/remote-config/remote-config.module.mjs +86 -0
- package/esm2022/storage/storage.module.mjs +74 -0
- package/esm2022/zones.mjs +196 -0
- package/{fesm2015/angular-fire-analytics.js → fesm2022/angular-fire-analytics.mjs} +61 -38
- package/fesm2022/angular-fire-analytics.mjs.map +1 -0
- package/{fesm2015/angular-fire-app-check.js → fesm2022/angular-fire-app-check.mjs} +15 -22
- package/fesm2022/angular-fire-app-check.mjs.map +1 -0
- package/{fesm2015/angular-fire-app.js → fesm2022/angular-fire-app.mjs} +8 -8
- package/fesm2022/angular-fire-app.mjs.map +1 -0
- package/{fesm2015/angular-fire-auth-guard.js → fesm2022/angular-fire-auth-guard.mjs} +25 -23
- package/fesm2022/angular-fire-auth-guard.mjs.map +1 -0
- package/{fesm2015/angular-fire-auth.js → fesm2022/angular-fire-auth.mjs} +10 -11
- package/fesm2022/angular-fire-auth.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat-analytics.js → fesm2022/angular-fire-compat-analytics.mjs} +28 -28
- package/fesm2022/angular-fire-compat-analytics.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat-auth-guard.js → fesm2022/angular-fire-compat-auth-guard.mjs} +25 -23
- package/fesm2022/angular-fire-compat-auth-guard.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat-auth.js → fesm2022/angular-fire-compat-auth.mjs} +32 -10
- package/fesm2022/angular-fire-compat-auth.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat-database.js → fesm2022/angular-fire-compat-database.mjs} +17 -12
- package/fesm2022/angular-fire-compat-database.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat-firestore.js → fesm2022/angular-fire-compat-firestore.mjs} +37 -16
- package/fesm2022/angular-fire-compat-firestore.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat-functions.js → fesm2022/angular-fire-compat-functions.mjs} +10 -9
- package/fesm2022/angular-fire-compat-functions.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat-messaging.js → fesm2022/angular-fire-compat-messaging.mjs} +20 -15
- package/fesm2022/angular-fire-compat-messaging.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat-performance.js → fesm2022/angular-fire-compat-performance.mjs} +16 -15
- package/fesm2022/angular-fire-compat-performance.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat-remote-config.js → fesm2022/angular-fire-compat-remote-config.mjs} +33 -19
- package/fesm2022/angular-fire-compat-remote-config.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat-storage.js → fesm2022/angular-fire-compat-storage.mjs} +23 -18
- package/fesm2022/angular-fire-compat-storage.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat.js → fesm2022/angular-fire-compat.mjs} +15 -17
- package/fesm2022/angular-fire-compat.mjs.map +1 -0
- package/{fesm2015/angular-fire-database.js → fesm2022/angular-fire-database.mjs} +10 -11
- package/fesm2022/angular-fire-database.mjs.map +1 -0
- package/{fesm2015/angular-fire-firestore-lite.js → fesm2022/angular-fire-firestore-lite.mjs} +10 -11
- package/fesm2022/angular-fire-firestore-lite.mjs.map +1 -0
- package/{fesm2015/angular-fire-firestore.js → fesm2022/angular-fire-firestore.mjs} +14 -13
- package/fesm2022/angular-fire-firestore.mjs.map +1 -0
- package/{fesm2015/angular-fire-functions.js → fesm2022/angular-fire-functions.mjs} +10 -11
- package/fesm2022/angular-fire-functions.mjs.map +1 -0
- package/{fesm2015/angular-fire-messaging.js → fesm2022/angular-fire-messaging.mjs} +33 -19
- package/fesm2022/angular-fire-messaging.mjs.map +1 -0
- package/{fesm2015/angular-fire-performance.js → fesm2022/angular-fire-performance.mjs} +8 -8
- package/fesm2022/angular-fire-performance.mjs.map +1 -0
- package/{fesm2015/angular-fire-remote-config.js → fesm2022/angular-fire-remote-config.mjs} +34 -20
- package/fesm2022/angular-fire-remote-config.mjs.map +1 -0
- package/{fesm2015/angular-fire-storage.js → fesm2022/angular-fire-storage.mjs} +10 -11
- package/fesm2022/angular-fire-storage.mjs.map +1 -0
- package/{fesm2015/angular-fire.js → fesm2022/angular-fire.mjs} +31 -52
- package/fesm2022/angular-fire.mjs.map +1 -0
- package/firestore/rxfire.d.ts +3 -1
- package/messaging/is-messaging-supported-factory.d.ts +4 -0
- package/package.json +158 -7
- package/publish.sh +1 -0
- package/remote-config/is-remote-config-supported-factory.d.ts +4 -0
- package/schematics/add/index.js +1 -1
- package/schematics/common.js +8 -4
- package/schematics/deploy/actions.js +59 -59
- package/schematics/deploy/builder.js +5 -5
- package/schematics/firebaseTools.js +9 -5
- package/schematics/setup/index.js +24 -23
- package/schematics/setup/prompts.js +20 -15
- package/schematics/update/v7/index.js +5 -5
- package/schematics/utils.js +30 -30
- package/README.md +0 -216
- package/analytics/package.json +0 -11
- package/app/package.json +0 -11
- package/app-check/package.json +0 -11
- package/auth/package.json +0 -11
- package/auth-guard/package.json +0 -11
- package/bundles/angular-fire-analytics.umd.js +0 -673
- package/bundles/angular-fire-analytics.umd.js.map +0 -1
- package/bundles/angular-fire-app-check.umd.js +0 -465
- package/bundles/angular-fire-app-check.umd.js.map +0 -1
- package/bundles/angular-fire-app.umd.js +0 -477
- package/bundles/angular-fire-app.umd.js.map +0 -1
- package/bundles/angular-fire-auth-guard.umd.js +0 -109
- package/bundles/angular-fire-auth-guard.umd.js.map +0 -1
- package/bundles/angular-fire-auth.umd.js +0 -557
- package/bundles/angular-fire-auth.umd.js.map +0 -1
- package/bundles/angular-fire-compat-analytics.umd.js +0 -672
- package/bundles/angular-fire-compat-analytics.umd.js.map +0 -1
- package/bundles/angular-fire-compat-auth-guard.umd.js +0 -112
- package/bundles/angular-fire-compat-auth-guard.umd.js.map +0 -1
- package/bundles/angular-fire-compat-auth.umd.js +0 -559
- package/bundles/angular-fire-compat-auth.umd.js.map +0 -1
- package/bundles/angular-fire-compat-database.umd.js +0 -799
- package/bundles/angular-fire-compat-database.umd.js.map +0 -1
- package/bundles/angular-fire-compat-firestore.umd.js +0 -1073
- package/bundles/angular-fire-compat-firestore.umd.js.map +0 -1
- package/bundles/angular-fire-compat-functions.umd.js +0 -443
- package/bundles/angular-fire-compat-functions.umd.js.map +0 -1
- package/bundles/angular-fire-compat-messaging.umd.js +0 -465
- package/bundles/angular-fire-compat-messaging.umd.js.map +0 -1
- package/bundles/angular-fire-compat-performance.umd.js +0 -212
- package/bundles/angular-fire-compat-performance.umd.js.map +0 -1
- package/bundles/angular-fire-compat-remote-config.umd.js +0 -605
- package/bundles/angular-fire-compat-remote-config.umd.js.map +0 -1
- package/bundles/angular-fire-compat-storage.umd.js +0 -598
- package/bundles/angular-fire-compat-storage.umd.js.map +0 -1
- package/bundles/angular-fire-compat.umd.js +0 -535
- package/bundles/angular-fire-compat.umd.js.map +0 -1
- package/bundles/angular-fire-database.umd.js +0 -557
- package/bundles/angular-fire-database.umd.js.map +0 -1
- package/bundles/angular-fire-firestore-lite.umd.js +0 -531
- package/bundles/angular-fire-firestore-lite.umd.js.map +0 -1
- package/bundles/angular-fire-firestore.umd.js +0 -565
- package/bundles/angular-fire-firestore.umd.js.map +0 -1
- package/bundles/angular-fire-functions.umd.js +0 -461
- package/bundles/angular-fire-functions.umd.js.map +0 -1
- package/bundles/angular-fire-messaging.umd.js +0 -473
- package/bundles/angular-fire-messaging.umd.js.map +0 -1
- package/bundles/angular-fire-performance.umd.js +0 -473
- package/bundles/angular-fire-performance.umd.js.map +0 -1
- package/bundles/angular-fire-remote-config.umd.js +0 -499
- package/bundles/angular-fire-remote-config.umd.js.map +0 -1
- package/bundles/angular-fire-storage.umd.js +0 -485
- package/bundles/angular-fire-storage.umd.js.map +0 -1
- package/bundles/angular-fire.umd.js +0 -308
- package/bundles/angular-fire.umd.js.map +0 -1
- package/compat/analytics/package.json +0 -11
- package/compat/auth/package.json +0 -11
- package/compat/auth-guard/package.json +0 -11
- package/compat/database/package.json +0 -11
- package/compat/firestore/package.json +0 -11
- package/compat/functions/package.json +0 -11
- package/compat/messaging/package.json +0 -11
- package/compat/package.json +0 -11
- package/compat/performance/package.json +0 -11
- package/compat/remote-config/package.json +0 -11
- package/compat/storage/package.json +0 -11
- package/database/package.json +0 -11
- package/docs/analytics.md +0 -67
- package/docs/app-check.md +0 -53
- package/docs/auth.md +0 -165
- package/docs/compat/analytics/getting-started.md +0 -137
- package/docs/compat/auth/getting-started.md +0 -162
- package/docs/compat/auth/router-guards.md +0 -104
- package/docs/compat/emulators/emulators.md +0 -134
- package/docs/compat/firestore/collections.md +0 -326
- package/docs/compat/firestore/documents.md +0 -115
- package/docs/compat/firestore/offline-data.md +0 -39
- package/docs/compat/firestore/querying-collections.md +0 -204
- package/docs/compat/functions/functions.md +0 -166
- package/docs/compat/messaging/messaging.md +0 -232
- package/docs/compat/performance/getting-started.md +0 -132
- package/docs/compat/remote-config/getting-started.md +0 -134
- package/docs/compat/rtdb/lists.md +0 -257
- package/docs/compat/rtdb/objects.md +0 -182
- package/docs/compat/rtdb/querying-lists.md +0 -155
- package/docs/compat/storage/storage.md +0 -257
- package/docs/compat.md +0 -70
- package/docs/database.md +0 -175
- package/docs/deploy/getting-started.md +0 -204
- package/docs/firebase.json +0 -16
- package/docs/firestore.md +0 -148
- package/docs/functions.md +0 -52
- package/docs/images/analytics-illo_1x.png +0 -0
- package/docs/images/auth-illo_1x.png +0 -0
- package/docs/images/cloud-messaging-illo_1x.png +0 -0
- package/docs/images/database-illo_1x.png +0 -0
- package/docs/images/firestore-illo_1x.png +0 -0
- package/docs/images/functions-illo_1x.png +0 -0
- package/docs/images/hosting-illo_1x.png +0 -0
- package/docs/images/performance-illo_1x.png +0 -0
- package/docs/images/reCAPTCHA-logo@1x.png +0 -0
- package/docs/images/remote-config-illo_1x.png +0 -0
- package/docs/images/storage-illo_1x.png +0 -0
- package/docs/install-and-setup.md +0 -114
- package/docs/install-angular-cli-windows10.md +0 -82
- package/docs/messaging.md +0 -25
- package/docs/performance.md +0 -57
- package/docs/remote-config.md +0 -53
- package/docs/storage.md +0 -90
- package/docs/universal/cloud-functions.md +0 -75
- package/docs/universal/getting-started.md +0 -153
- package/docs/universal/prerendering.md +0 -72
- package/docs/version-4-upgrade.md +0 -119
- package/docs/version-5-upgrade.md +0 -82
- package/docs/version-6-upgrade.md +0 -16
- package/docs/version-7-upgrade.md +0 -298
- package/esm2015/analytics/analytics.module.js +0 -93
- package/esm2015/analytics/overrides.js +0 -3
- package/esm2015/analytics/screen-tracking.service.js +0 -139
- package/esm2015/analytics/user-tracking.service.js +0 -43
- package/esm2015/app/app.module.js +0 -84
- package/esm2015/app-check/app-check.js +0 -16
- package/esm2015/app-check/app-check.module.js +0 -81
- package/esm2015/app-check/public_api.js +0 -4
- package/esm2015/auth/auth.module.js +0 -71
- package/esm2015/auth-guard/auth-guard.js +0 -49
- package/esm2015/compat/analytics/analytics.js +0 -163
- package/esm2015/compat/analytics/screen-tracking.service.js +0 -49
- package/esm2015/compat/analytics/user-tracking.service.js +0 -52
- package/esm2015/compat/auth/auth.js +0 -139
- package/esm2015/compat/auth-guard/auth-guard.js +0 -49
- package/esm2015/compat/database/database.js +0 -117
- package/esm2015/compat/database/list/create-reference.js +0 -41
- package/esm2015/compat/firestore/collection/changes.js +0 -107
- package/esm2015/compat/firestore/collection/collection.js +0 -117
- package/esm2015/compat/firestore/collection-group/collection-group.js +0 -81
- package/esm2015/compat/firestore/document/document.js +0 -82
- package/esm2015/compat/firestore/firestore.js +0 -254
- package/esm2015/compat/firestore/interfaces.js +0 -2
- package/esm2015/compat/firestore/observable/fromRef.js +0 -39
- package/esm2015/compat/functions/functions.js +0 -68
- package/esm2015/compat/messaging/messaging.js +0 -75
- package/esm2015/compat/performance/performance.service.js +0 -27
- package/esm2015/compat/proxy.js +0 -61
- package/esm2015/compat/remote-config/remote-config.js +0 -193
- package/esm2015/compat/storage/pipes/storageUrl.pipe.js +0 -54
- package/esm2015/compat/storage/storage.js +0 -94
- package/esm2015/core.js +0 -79
- package/esm2015/database/database.module.js +0 -74
- package/esm2015/firestore/firestore.module.js +0 -74
- package/esm2015/firestore/lite/lite.module.js +0 -74
- package/esm2015/firestore/rxfire.js +0 -13
- package/esm2015/functions/functions.module.js +0 -74
- package/esm2015/messaging/messaging.module.js +0 -85
- package/esm2015/messaging/overrides.js +0 -3
- package/esm2015/remote-config/overrides.js +0 -3
- package/esm2015/remote-config/remote-config.module.js +0 -85
- package/esm2015/storage/storage.module.js +0 -74
- package/esm2015/zones.js +0 -183
- package/fesm2015/angular-fire-analytics.js.map +0 -1
- package/fesm2015/angular-fire-app-check.js.map +0 -1
- package/fesm2015/angular-fire-app.js.map +0 -1
- package/fesm2015/angular-fire-auth-guard.js.map +0 -1
- package/fesm2015/angular-fire-auth.js.map +0 -1
- package/fesm2015/angular-fire-compat-analytics.js.map +0 -1
- package/fesm2015/angular-fire-compat-auth-guard.js.map +0 -1
- package/fesm2015/angular-fire-compat-auth.js.map +0 -1
- package/fesm2015/angular-fire-compat-database.js.map +0 -1
- package/fesm2015/angular-fire-compat-firestore.js.map +0 -1
- package/fesm2015/angular-fire-compat-functions.js.map +0 -1
- package/fesm2015/angular-fire-compat-messaging.js.map +0 -1
- package/fesm2015/angular-fire-compat-performance.js.map +0 -1
- package/fesm2015/angular-fire-compat-remote-config.js.map +0 -1
- package/fesm2015/angular-fire-compat-storage.js.map +0 -1
- package/fesm2015/angular-fire-compat.js.map +0 -1
- package/fesm2015/angular-fire-database.js.map +0 -1
- package/fesm2015/angular-fire-firestore-lite.js.map +0 -1
- package/fesm2015/angular-fire-firestore.js.map +0 -1
- package/fesm2015/angular-fire-functions.js.map +0 -1
- package/fesm2015/angular-fire-messaging.js.map +0 -1
- package/fesm2015/angular-fire-performance.js.map +0 -1
- package/fesm2015/angular-fire-remote-config.js.map +0 -1
- package/fesm2015/angular-fire-storage.js.map +0 -1
- package/fesm2015/angular-fire.js.map +0 -1
- package/firestore/lite/package.json +0 -11
- package/firestore/package.json +0 -11
- package/firestore-protos.js +0 -4
- package/functions/package.json +0 -11
- package/messaging/package.json +0 -11
- package/performance/package.json +0 -11
- package/remote-config/package.json +0 -11
- package/schematics/add/schema.json +0 -16
- package/schematics/builders.json +0 -10
- package/schematics/collection.json +0 -15
- package/schematics/deploy/schema.json +0 -119
- package/schematics/migration.json +0 -15
- package/schematics/setup/schema.json +0 -16
- package/storage/package.json +0 -11
- /package/analytics/{angular-fire-analytics.d.ts → index.d.ts} +0 -0
- /package/app/{angular-fire-app.d.ts → index.d.ts} +0 -0
- /package/app-check/{angular-fire-app-check.d.ts → index.d.ts} +0 -0
- /package/auth/{angular-fire-auth.d.ts → index.d.ts} +0 -0
- /package/auth-guard/{angular-fire-auth-guard.d.ts → index.d.ts} +0 -0
- /package/compat/analytics/{angular-fire-compat-analytics.d.ts → index.d.ts} +0 -0
- /package/compat/auth/{angular-fire-compat-auth.d.ts → index.d.ts} +0 -0
- /package/compat/auth-guard/{angular-fire-compat-auth-guard.d.ts → index.d.ts} +0 -0
- /package/compat/database/{angular-fire-compat-database.d.ts → index.d.ts} +0 -0
- /package/compat/firestore/{angular-fire-compat-firestore.d.ts → index.d.ts} +0 -0
- /package/compat/functions/{angular-fire-compat-functions.d.ts → index.d.ts} +0 -0
- /package/compat/{angular-fire-compat.d.ts → index.d.ts} +0 -0
- /package/compat/messaging/{angular-fire-compat-messaging.d.ts → index.d.ts} +0 -0
- /package/compat/performance/{angular-fire-compat-performance.d.ts → index.d.ts} +0 -0
- /package/compat/remote-config/{angular-fire-compat-remote-config.d.ts → index.d.ts} +0 -0
- /package/compat/storage/{angular-fire-compat-storage.d.ts → index.d.ts} +0 -0
- /package/database/{angular-fire-database.d.ts → index.d.ts} +0 -0
- /package/{esm2015/analytics/analytics.js → esm2022/analytics/analytics.mjs} +0 -0
- /package/{esm2015/analytics/angular-fire-analytics.js → esm2022/analytics/angular-fire-analytics.mjs} +0 -0
- /package/{esm2015/analytics/firebase.js → esm2022/analytics/firebase.mjs} +0 -0
- /package/{esm2015/analytics/public_api.js → esm2022/analytics/public_api.mjs} +0 -0
- /package/{esm2015/angular-fire.js → esm2022/angular-fire.mjs} +0 -0
- /package/{esm2015/app/angular-fire-app.js → esm2022/app/angular-fire-app.mjs} +0 -0
- /package/{esm2015/app/app.js → esm2022/app/app.mjs} +0 -0
- /package/{esm2015/app/firebase.js → esm2022/app/firebase.mjs} +0 -0
- /package/{esm2015/app/public_api.js → esm2022/app/public_api.mjs} +0 -0
- /package/{esm2015/app-check/angular-fire-app-check.js → esm2022/app-check/angular-fire-app-check.mjs} +0 -0
- /package/{esm2015/app-check/firebase.js → esm2022/app-check/firebase.mjs} +0 -0
- /package/{esm2015/auth/angular-fire-auth.js → esm2022/auth/angular-fire-auth.mjs} +0 -0
- /package/{esm2015/auth/auth.js → esm2022/auth/auth.mjs} +0 -0
- /package/{esm2015/auth/firebase.js → esm2022/auth/firebase.mjs} +0 -0
- /package/{esm2015/auth/public_api.js → esm2022/auth/public_api.mjs} +0 -0
- /package/{esm2015/auth/rxfire.js → esm2022/auth/rxfire.mjs} +0 -0
- /package/{esm2015/auth-guard/angular-fire-auth-guard.js → esm2022/auth-guard/angular-fire-auth-guard.mjs} +0 -0
- /package/{esm2015/auth-guard/public_api.js → esm2022/auth-guard/public_api.mjs} +0 -0
- /package/{esm2015/compat/analytics/angular-fire-compat-analytics.js → esm2022/compat/analytics/angular-fire-compat-analytics.mjs} +0 -0
- /package/{esm2015/compat/analytics/base.js → esm2022/compat/analytics/base.mjs} +0 -0
- /package/{esm2015/compat/analytics/public_api.js → esm2022/compat/analytics/public_api.mjs} +0 -0
- /package/{esm2015/compat/angular-fire-compat.js → esm2022/compat/angular-fire-compat.mjs} +0 -0
- /package/{esm2015/compat/auth/angular-fire-compat-auth.js → esm2022/compat/auth/angular-fire-compat-auth.mjs} +0 -0
- /package/{esm2015/compat/auth/base.js → esm2022/compat/auth/base.mjs} +0 -0
- /package/{esm2015/compat/auth-guard/angular-fire-compat-auth-guard.js → esm2022/compat/auth-guard/angular-fire-compat-auth-guard.mjs} +0 -0
- /package/{esm2015/compat/auth-guard/public_api.js → esm2022/compat/auth-guard/public_api.mjs} +0 -0
- /package/{esm2015/compat/database/angular-fire-compat-database.js → esm2022/compat/database/angular-fire-compat-database.mjs} +0 -0
- /package/{esm2015/compat/database/interfaces.js → esm2022/compat/database/interfaces.mjs} +0 -0
- /package/{esm2015/compat/database/list/audit-trail.js → esm2022/compat/database/list/audit-trail.mjs} +0 -0
- /package/{esm2015/compat/database/list/changes.js → esm2022/compat/database/list/changes.mjs} +0 -0
- /package/{esm2015/compat/database/list/data-operation.js → esm2022/compat/database/list/data-operation.mjs} +0 -0
- /package/{esm2015/compat/database/list/remove.js → esm2022/compat/database/list/remove.mjs} +0 -0
- /package/{esm2015/compat/database/list/snapshot-changes.js → esm2022/compat/database/list/snapshot-changes.mjs} +0 -0
- /package/{esm2015/compat/database/list/state-changes.js → esm2022/compat/database/list/state-changes.mjs} +0 -0
- /package/{esm2015/compat/database/list/utils.js → esm2022/compat/database/list/utils.mjs} +0 -0
- /package/{esm2015/compat/database/object/create-reference.js → esm2022/compat/database/object/create-reference.mjs} +0 -0
- /package/{esm2015/compat/database/object/snapshot-changes.js → esm2022/compat/database/object/snapshot-changes.mjs} +0 -0
- /package/{esm2015/compat/database/observable/fromRef.js → esm2022/compat/database/observable/fromRef.mjs} +0 -0
- /package/{esm2015/compat/database/public_api.js → esm2022/compat/database/public_api.mjs} +0 -0
- /package/{esm2015/compat/database/utils.js → esm2022/compat/database/utils.mjs} +0 -0
- /package/{esm2015/compat/firebase.app.js → esm2022/compat/firebase.app.mjs} +0 -0
- /package/{esm2015/compat/firestore/angular-fire-compat-firestore.js → esm2022/compat/firestore/angular-fire-compat-firestore.mjs} +0 -0
- /package/{esm2015/compat/firestore/public_api.js → esm2022/compat/firestore/public_api.mjs} +0 -0
- /package/{esm2015/compat/functions/angular-fire-compat-functions.js → esm2022/compat/functions/angular-fire-compat-functions.mjs} +0 -0
- /package/{esm2015/compat/functions/base.js → esm2022/compat/functions/base.mjs} +0 -0
- /package/{esm2015/compat/messaging/angular-fire-compat-messaging.js → esm2022/compat/messaging/angular-fire-compat-messaging.mjs} +0 -0
- /package/{esm2015/compat/messaging/base.js → esm2022/compat/messaging/base.mjs} +0 -0
- /package/{esm2015/compat/messaging/public_api.js → esm2022/compat/messaging/public_api.mjs} +0 -0
- /package/{esm2015/compat/performance/angular-fire-compat-performance.js → esm2022/compat/performance/angular-fire-compat-performance.mjs} +0 -0
- /package/{esm2015/compat/performance/base.js → esm2022/compat/performance/base.mjs} +0 -0
- /package/{esm2015/compat/performance/public_api.js → esm2022/compat/performance/public_api.mjs} +0 -0
- /package/{esm2015/compat/public_api.js → esm2022/compat/public_api.mjs} +0 -0
- /package/{esm2015/compat/remote-config/angular-fire-compat-remote-config.js → esm2022/compat/remote-config/angular-fire-compat-remote-config.mjs} +0 -0
- /package/{esm2015/compat/remote-config/base.js → esm2022/compat/remote-config/base.mjs} +0 -0
- /package/{esm2015/compat/remote-config/interfaces.js → esm2022/compat/remote-config/interfaces.mjs} +0 -0
- /package/{esm2015/compat/remote-config/public_api.js → esm2022/compat/remote-config/public_api.mjs} +0 -0
- /package/{esm2015/compat/storage/angular-fire-compat-storage.js → esm2022/compat/storage/angular-fire-compat-storage.mjs} +0 -0
- /package/{esm2015/compat/storage/interfaces.js → esm2022/compat/storage/interfaces.mjs} +0 -0
- /package/{esm2015/compat/storage/observable/fromTask.js → esm2022/compat/storage/observable/fromTask.mjs} +0 -0
- /package/{esm2015/compat/storage/public_api.js → esm2022/compat/storage/public_api.mjs} +0 -0
- /package/{esm2015/compat/storage/ref.js → esm2022/compat/storage/ref.mjs} +0 -0
- /package/{esm2015/compat/storage/task.js → esm2022/compat/storage/task.mjs} +0 -0
- /package/{esm2015/database/angular-fire-database.js → esm2022/database/angular-fire-database.mjs} +0 -0
- /package/{esm2015/database/database.js → esm2022/database/database.mjs} +0 -0
- /package/{esm2015/database/firebase.js → esm2022/database/firebase.mjs} +0 -0
- /package/{esm2015/database/public_api.js → esm2022/database/public_api.mjs} +0 -0
- /package/{esm2015/database/rxfire.js → esm2022/database/rxfire.mjs} +0 -0
- /package/{esm2015/firestore/angular-fire-firestore.js → esm2022/firestore/angular-fire-firestore.mjs} +0 -0
- /package/{esm2015/firestore/firebase.js → esm2022/firestore/firebase.mjs} +0 -0
- /package/{esm2015/firestore/firestore.js → esm2022/firestore/firestore.mjs} +0 -0
- /package/{esm2015/firestore/lite/angular-fire-firestore-lite.js → esm2022/firestore/lite/angular-fire-firestore-lite.mjs} +0 -0
- /package/{esm2015/firestore/lite/firebase.js → esm2022/firestore/lite/firebase.mjs} +0 -0
- /package/{esm2015/firestore/lite/lite.js → esm2022/firestore/lite/lite.mjs} +0 -0
- /package/{esm2015/firestore/lite/public_api.js → esm2022/firestore/lite/public_api.mjs} +0 -0
- /package/{esm2015/firestore/lite/rxfire.js → esm2022/firestore/lite/rxfire.mjs} +0 -0
- /package/{esm2015/firestore/public_api.js → esm2022/firestore/public_api.mjs} +0 -0
- /package/{esm2015/functions/angular-fire-functions.js → esm2022/functions/angular-fire-functions.mjs} +0 -0
- /package/{esm2015/functions/firebase.js → esm2022/functions/firebase.mjs} +0 -0
- /package/{esm2015/functions/functions.js → esm2022/functions/functions.mjs} +0 -0
- /package/{esm2015/functions/public_api.js → esm2022/functions/public_api.mjs} +0 -0
- /package/{esm2015/functions/rxfire.js → esm2022/functions/rxfire.mjs} +0 -0
- /package/{esm2015/messaging/angular-fire-messaging.js → esm2022/messaging/angular-fire-messaging.mjs} +0 -0
- /package/{esm2015/messaging/firebase.js → esm2022/messaging/firebase.mjs} +0 -0
- /package/{esm2015/messaging/messaging.js → esm2022/messaging/messaging.mjs} +0 -0
- /package/{esm2015/messaging/public_api.js → esm2022/messaging/public_api.mjs} +0 -0
- /package/{esm2015/performance/angular-fire-performance.js → esm2022/performance/angular-fire-performance.mjs} +0 -0
- /package/{esm2015/performance/firebase.js → esm2022/performance/firebase.mjs} +0 -0
- /package/{esm2015/performance/performance.js → esm2022/performance/performance.mjs} +0 -0
- /package/{esm2015/performance/public_api.js → esm2022/performance/public_api.mjs} +0 -0
- /package/{esm2015/performance/rxfire.js → esm2022/performance/rxfire.mjs} +0 -0
- /package/{esm2015/public_api.js → esm2022/public_api.mjs} +0 -0
- /package/{esm2015/remote-config/angular-fire-remote-config.js → esm2022/remote-config/angular-fire-remote-config.mjs} +0 -0
- /package/{esm2015/remote-config/firebase.js → esm2022/remote-config/firebase.mjs} +0 -0
- /package/{esm2015/remote-config/public_api.js → esm2022/remote-config/public_api.mjs} +0 -0
- /package/{esm2015/remote-config/remote-config.js → esm2022/remote-config/remote-config.mjs} +0 -0
- /package/{esm2015/remote-config/rxfire.js → esm2022/remote-config/rxfire.mjs} +0 -0
- /package/{esm2015/storage/angular-fire-storage.js → esm2022/storage/angular-fire-storage.mjs} +0 -0
- /package/{esm2015/storage/firebase.js → esm2022/storage/firebase.mjs} +0 -0
- /package/{esm2015/storage/public_api.js → esm2022/storage/public_api.mjs} +0 -0
- /package/{esm2015/storage/rxfire.js → esm2022/storage/rxfire.mjs} +0 -0
- /package/{esm2015/storage/storage.js → esm2022/storage/storage.mjs} +0 -0
- /package/firestore/{angular-fire-firestore.d.ts → index.d.ts} +0 -0
- /package/firestore/lite/{angular-fire-firestore-lite.d.ts → index.d.ts} +0 -0
- /package/functions/{angular-fire-functions.d.ts → index.d.ts} +0 -0
- /package/{angular-fire.d.ts → index.d.ts} +0 -0
- /package/messaging/{angular-fire-messaging.d.ts → index.d.ts} +0 -0
- /package/performance/{angular-fire-performance.d.ts → index.d.ts} +0 -0
- /package/remote-config/{angular-fire-remote-config.d.ts → index.d.ts} +0 -0
- /package/storage/{angular-fire-storage.d.ts → index.d.ts} +0 -0
package/docs/database.md
DELETED
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
<img align="right" width="30%" src="images/database-illo_1x.png">
|
|
2
|
-
|
|
3
|
-
<small>
|
|
4
|
-
<a href="https://github.com/angular/angularfire">AngularFire</a> ❱ <a href="../README.md#developer-guide">Developer Guide</a> ❱ Realtime Database
|
|
5
|
-
</small>
|
|
6
|
-
|
|
7
|
-
# Realtime Database
|
|
8
|
-
|
|
9
|
-
Store and sync data with our NoSQL cloud database. Data is synced across all clients in realtime, and remains available when your app goes offline.
|
|
10
|
-
|
|
11
|
-
The Firebase Realtime Database is a cloud-hosted database. Data is stored as JSON and synchronized in realtime to every connected client. When you build cross-platform apps with our iOS, Android, and JavaScript SDKs, all of your clients share one Realtime Database instance and automatically receive updates with the newest data. [Learn more about the Realtime Database](https://firebase.google.com/docs/database).
|
|
12
|
-
|
|
13
|
-
## Dependency Injection
|
|
14
|
-
|
|
15
|
-
As a prerequisite, ensure that `AngularFire` has been added to your project via
|
|
16
|
-
```bash
|
|
17
|
-
ng add @angular/fire
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
Provide an RTBD instance in the application's `NgModule` (`app.module.ts`):
|
|
21
|
-
|
|
22
|
-
```ts
|
|
23
|
-
import { provideFirebaseApp, initializeApp } from '@angular/fire/app';
|
|
24
|
-
import { getDatabase, provideDatabase } from '@angular/fire/database';
|
|
25
|
-
|
|
26
|
-
@NgModule({
|
|
27
|
-
imports: [
|
|
28
|
-
provideFirebaseApp(() => initializeApp(environment.firebase)),
|
|
29
|
-
provideDatabase(() => getDatabase()),
|
|
30
|
-
]
|
|
31
|
-
})
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
Next inject it into your component:
|
|
35
|
-
|
|
36
|
-
```ts
|
|
37
|
-
import { Component, inject } from '@angular/core';
|
|
38
|
-
import { Database } from '@angular/fire/database';
|
|
39
|
-
|
|
40
|
-
@Component({...})
|
|
41
|
-
extend class DepartmentComponent {
|
|
42
|
-
private database: Database = inject(Database);
|
|
43
|
-
|
|
44
|
-
constructor() {
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
## Firebase API
|
|
50
|
-
|
|
51
|
-
AngularFire wraps the Firebase JS SDK to ensure proper functionality in Angular, while providing the same API.
|
|
52
|
-
|
|
53
|
-
Just change your imports from `import { ... } from 'firebase/database'` to `import { ... } from '@angular/fire/database'` and follow the offical documentation.
|
|
54
|
-
|
|
55
|
-
[Getting Started](https://firebase.google.com/docs/database/web/start) | [API Reference](https://firebase.google.com/docs/reference/js/database)
|
|
56
|
-
|
|
57
|
-
## Convenience observables
|
|
58
|
-
|
|
59
|
-
AngularFire provides observables to allow convenient use of the Realtime Database with RXJS.
|
|
60
|
-
|
|
61
|
-
### `object`
|
|
62
|
-
|
|
63
|
-
The `object()` function creates an observable that emits object changes.
|
|
64
|
-
|
|
65
|
-
| | |
|
|
66
|
-
|-----------------|------------------------------------------|
|
|
67
|
-
| **function** | `object(ref)` |
|
|
68
|
-
| **params** | ref: `Reference` |
|
|
69
|
-
| **return** | `Observable<QueryChange>` |
|
|
70
|
-
|
|
71
|
-
### `objectVal`
|
|
72
|
-
|
|
73
|
-
The `objectVal` function creates an observable that emits an array of object values, optionally with a mapped key.
|
|
74
|
-
|
|
75
|
-
| | |
|
|
76
|
-
|-----------------|-------------------------------------------------------|
|
|
77
|
-
| **function** | `objectVal(query, options?)` |
|
|
78
|
-
| **params** | query: `Reference\|Query`, options?: { keyField?: `string` } |
|
|
79
|
-
| **return** | `Observable<T>` |
|
|
80
|
-
|
|
81
|
-
### `list`
|
|
82
|
-
|
|
83
|
-
The `list()` function creates an observable that emits a sorted array for each child event change. The optional `events` parameter will filter which child events populate the array.
|
|
84
|
-
|
|
85
|
-
| | |
|
|
86
|
-
|-----------------|-------------------------------------------------------|
|
|
87
|
-
| **function** | `list(ref, options?)` |
|
|
88
|
-
| **params** | ref: `Reference\|Query`, options?: { events?: `ListenEvent[]` } |
|
|
89
|
-
| **return** | `Observable<QueryChange[]>` |
|
|
90
|
-
|
|
91
|
-
### `listVal`
|
|
92
|
-
|
|
93
|
-
The `listVal()` function creates an observable that emits an object mapped to its value, and optionally its key.
|
|
94
|
-
|
|
95
|
-
| | |
|
|
96
|
-
|-----------------|-------------------------------------------------------|
|
|
97
|
-
| **function** | `listVal(query, options?)` |
|
|
98
|
-
| **params** | ref: `Reference\|Query`, options?: { keyField?: `string` } |
|
|
99
|
-
| **return** | `Observable<T \| null>` |
|
|
100
|
-
|
|
101
|
-
### `stateChanges`
|
|
102
|
-
|
|
103
|
-
The `stateChanges()` function creates an observable that emits each time a change occurs at the reference or query passed. This is useful for tracking the changes in your list. The optional `events` parameter will filter which child events populate the array.
|
|
104
|
-
|
|
105
|
-
| | |
|
|
106
|
-
|-----------------|------------------------------------------------------|
|
|
107
|
-
| **function** | `stateChanges(ref, options?)` |
|
|
108
|
-
| **params** | ref: `Reference\|Query`, options:? { events?: `ListenEvent[]` } |
|
|
109
|
-
| **return** | `Observable<QueryChange>` |
|
|
110
|
-
|
|
111
|
-
### `auditTrail`
|
|
112
|
-
|
|
113
|
-
The `auditTrail()` function creates an observable that emits the entire state trail. This is useful for debugging or replaying the state of a list in your app. The optional `events` parameter will filter which child events populate the array.
|
|
114
|
-
|
|
115
|
-
| | |
|
|
116
|
-
|-----------------|------------------------------------------------------|
|
|
117
|
-
| **function** | `auditTrail(ref, options?)` |
|
|
118
|
-
| **params** | ref: `Reference\|Query`, options?: { events?: `ListenEvent[]` } |
|
|
119
|
-
| **return** | `Observable<QueryChange[]>` |
|
|
120
|
-
|
|
121
|
-
### `fromRef`
|
|
122
|
-
|
|
123
|
-
The `fromRef()` function creates an observable that emits reference changes.
|
|
124
|
-
|
|
125
|
-
| | |
|
|
126
|
-
|-----------------|------------------------------------------|
|
|
127
|
-
| **function** | `fromRef(ref, event)` |
|
|
128
|
-
| **params** | ref: `Reference\|Query`, event: `ListenEvent` |
|
|
129
|
-
| **return** | `Observable<QueryChange>` |
|
|
130
|
-
|
|
131
|
-
## Connecting the the emulator suite
|
|
132
|
-
|
|
133
|
-
```ts
|
|
134
|
-
import { connectDatabaseEmulator, getDatabase, provideDatabase } from '@angular/fire/database';
|
|
135
|
-
|
|
136
|
-
@NgModule({
|
|
137
|
-
imports: [
|
|
138
|
-
provideDatabase(() => {
|
|
139
|
-
const database = getDatabase();
|
|
140
|
-
connectDatabaseEmulator(database, 'localhost', 9000);
|
|
141
|
-
return database;
|
|
142
|
-
}),
|
|
143
|
-
]
|
|
144
|
-
})
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
## Working with multiple instances
|
|
148
|
-
|
|
149
|
-
```ts
|
|
150
|
-
import { provideFirebaseApp, FirebaseApp, initializeApp } from '@angular/fire/app';
|
|
151
|
-
import { getDatabase, provideDatabase } from '@angular/fire/database';
|
|
152
|
-
|
|
153
|
-
const DATABASE_SHARD_URLS = [
|
|
154
|
-
'https://FOO.firebaseio.com',
|
|
155
|
-
'https://BAR.firebaseio.com',
|
|
156
|
-
'https://BAZ.firebaseio.com',
|
|
157
|
-
];
|
|
158
|
-
|
|
159
|
-
@NgModule({
|
|
160
|
-
imports: [
|
|
161
|
-
provideFirebaseApp(() => initializeApp(environment.firebase)),
|
|
162
|
-
provideDatabase((app: FirebaseApp) => getDatabase(app, DATABASE_SHARD_URLS[0])),
|
|
163
|
-
provideDatabase((app: FirebaseApp) => getDatabase(app, DATABASE_SHARD_URLS[1])),
|
|
164
|
-
provideDatabase((app: FirebaseApp) => getDatabase(app, DATABASE_SHARD_URLS[2])),
|
|
165
|
-
]
|
|
166
|
-
})
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
```ts
|
|
170
|
-
import { DatabaseInstances } from '@angular/fire/database';
|
|
171
|
-
|
|
172
|
-
constructor(databases: DatabaseInstances) {
|
|
173
|
-
// databases => Database[]
|
|
174
|
-
}
|
|
175
|
-
```
|
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
# Deploy your application on Firebase Hosting & Functions
|
|
2
|
-
|
|
3
|
-
In this guide, we'll look at how to use `@angular/fire` to automatically deploy an Angular application to Firebase hosting or functions by using the Angular CLI.
|
|
4
|
-
|
|
5
|
-
`@angular/fire` uses Firebase functions to deploy your Angular universal projects, with server-side rendering enabled.
|
|
6
|
-
|
|
7
|
-
**Angular Universal deployments work with `@nguniversal/*` version 9.0.0 and above**.
|
|
8
|
-
|
|
9
|
-
## Step 1: add `@angular/fire` to your project
|
|
10
|
-
|
|
11
|
-
First, you need to add the `@angular/fire` package to your project. In your Angular CLI project run:
|
|
12
|
-
|
|
13
|
-
```shell
|
|
14
|
-
ng add @angular/fire
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
*Note that the command above assumes you have global Angular CLI installed. To install Angular CLI globally run `npm i -g @angular/cli`.*
|
|
18
|
-
|
|
19
|
-
First, the command above will check if you have an Angular universal project. It'll do so by looking at your `angular.json` project, looking for a `server` target for the specified project. If it finds one, it'll ask you if you want to deploy the project in a firebase function.
|
|
20
|
-
|
|
21
|
-
After that it will trigger the `@angular/fire` `ng-add` schematics. The schematics will open a web browser and guide you through the Firebase authentication flow (if you're not signed in already). After you authenticate, you'll see a prompt to select a Firebase hosting project.
|
|
22
|
-
|
|
23
|
-
The schematics will do the following:
|
|
24
|
-
|
|
25
|
-
- Add `@angular/fire` to your list of dependencies
|
|
26
|
-
- Create `firebase.json`, `.firebaserc` files in the root of your workspace. You can use them to configure your firebase hosting deployment. Find more about them [here](https://firebase.google.com/docs/hosting/full-config)
|
|
27
|
-
- Update your workspace file (`angular.json`) by inserting the `deploy` builder
|
|
28
|
-
|
|
29
|
-
In the end, your `angular.json` project will look like below:
|
|
30
|
-
|
|
31
|
-
```json5
|
|
32
|
-
{
|
|
33
|
-
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
|
34
|
-
"version": 1,
|
|
35
|
-
"newProjectRoot": "projects",
|
|
36
|
-
"projects": {
|
|
37
|
-
"sample-app": {
|
|
38
|
-
// ...
|
|
39
|
-
"deploy": {
|
|
40
|
-
"builder": "@angular/fire:deploy",
|
|
41
|
-
"options": {} // Here you may find an "ssr": true option if you've
|
|
42
|
-
// selected that you want to deploy your Angular universal project
|
|
43
|
-
// as a firebase function.
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
// ...
|
|
48
|
-
"defaultProject": "sample-app"
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
If you want to add deployment capabilities to a different project in your workspace, you can run:
|
|
54
|
-
|
|
55
|
-
```
|
|
56
|
-
ng add @angular/fire --project=[PROJECT_NAME]
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
## Step 2: deploying the project
|
|
60
|
-
|
|
61
|
-
As the second step, to deploy your project run:
|
|
62
|
-
|
|
63
|
-
```
|
|
64
|
-
ng deploy --project=[PROJECT_NAME]
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
*The `--project` option is optional. Learn more [here](https://angular.io/cli/deploy).*
|
|
68
|
-
|
|
69
|
-
The command above will trigger:
|
|
70
|
-
|
|
71
|
-
1. Production build of your application
|
|
72
|
-
2. Deployment of the produced assets to the firebase hosting project you selected during `ng add`
|
|
73
|
-
|
|
74
|
-
If you've specified that you want a server-side rendering enabled deployment in a firebase function, the command will also:
|
|
75
|
-
|
|
76
|
-
1. Create a firebase function in `dist`, which directly consumes `main.js` from your server output directory.
|
|
77
|
-
2. Create `package.json` for the firebase function with the required dependencies.
|
|
78
|
-
3. Deploy the static assets to firebase hosting and your universal server as a Firebase function.
|
|
79
|
-
|
|
80
|
-
If you want to preview your Angular Universal project before we deploy it as a Firebase Function you can run:
|
|
81
|
-
|
|
82
|
-
```
|
|
83
|
-
ng deploy --preview
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
We'll create the function and a `package.json` in your project output directory. This way, you can later run `firebase serve` in your project root so you can test everything before deploying.
|
|
87
|
-
|
|
88
|
-
## Step 3: customization
|
|
89
|
-
|
|
90
|
-
To customize the deployment flow, you can use the configuration files you're already familiar with from `firebase-tools`. You can find more in the [firebase documentation](https://firebase.google.com/docs/hosting/full-config).
|
|
91
|
-
|
|
92
|
-
### Configuring Cloud Functions
|
|
93
|
-
|
|
94
|
-
Setting `functionsNodeVersion` and `functionsRuntimeOptions` in your `angular.json` allow you to custimze the version of Node.js Cloud Functions is running and run-time settings like timeout, VPC connectors, and memory.
|
|
95
|
-
|
|
96
|
-
```json
|
|
97
|
-
"deploy": {
|
|
98
|
-
"builder": "@angular/fire:deploy",
|
|
99
|
-
"options": {
|
|
100
|
-
"functionsNodeVersion": 12,
|
|
101
|
-
"functionsRuntimeOptions": {
|
|
102
|
-
"memory": "2GB",
|
|
103
|
-
"timeoutSeconds": 10,
|
|
104
|
-
"vpcConnector": "my-vpc-connector",
|
|
105
|
-
"vpcConnectorEgressSettings": "PRIVATE_RANGES_ONLY"
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
### Working with multiple Firebase Projects
|
|
112
|
-
|
|
113
|
-
If you have multiple build targets and deploy targets, it is possible to specify them in your `angular.json` or `workspace.json`.
|
|
114
|
-
|
|
115
|
-
It is possible to use either your project name or project alias in `firebaseProject`. The setting provided here is equivalent to passing a project name or alias to `firebase deploy --project projectNameOrAlias`.
|
|
116
|
-
|
|
117
|
-
The `buildTarget` simply points to an existing build configuration for your project. Most projects have a default configuration and a production configuration (commonly activated by using the `--prod` flag) but it is possible to specify as many build configurations as needed.
|
|
118
|
-
|
|
119
|
-
You may specify a `buildTarget` and `firebaseProject` in your `options` as follows:
|
|
120
|
-
|
|
121
|
-
```json
|
|
122
|
-
"deploy": {
|
|
123
|
-
"builder": "@angular/fire:deploy",
|
|
124
|
-
"options": {
|
|
125
|
-
"buildTarget": "projectName:build",
|
|
126
|
-
"firebaseProject": "developmentProject"
|
|
127
|
-
},
|
|
128
|
-
"configurations": {
|
|
129
|
-
"production": {
|
|
130
|
-
"buildTarget": "projectName:build:production",
|
|
131
|
-
"firebaseProject": "productionProject"
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
The above configuration specifies the following:
|
|
138
|
-
|
|
139
|
-
1. `ng deploy` will deploy the default project with default configuration.
|
|
140
|
-
2. `ng deploy projectName` will deploy the specified project with default configuration.
|
|
141
|
-
3. `ng deploy projectName --prod` or `ng deploy projectName --configuration='production'` will deploy `projectName` with production build settings to your production environment.
|
|
142
|
-
|
|
143
|
-
All of the options are optional. If you do not specify a `buildTarget`, it defaults to a production build (`projectName:build:production`). If you do not specify a `firebaseProject`, it defaults to the first matching deploy target found in your `.firebaserc` (where your projectName is the same as your Firebase deploy target name). The `configurations` section is also optional.
|
|
144
|
-
|
|
145
|
-
### Working with multiple project sites
|
|
146
|
-
|
|
147
|
-
For example, if you have muti sites config in firebase.json like this:
|
|
148
|
-
```
|
|
149
|
-
{
|
|
150
|
-
"hosting": [
|
|
151
|
-
{
|
|
152
|
-
"target": "custom-site",
|
|
153
|
-
"public": "public/my-custom-site",
|
|
154
|
-
"ignore": [
|
|
155
|
-
"firebase.json",
|
|
156
|
-
"**/.*",
|
|
157
|
-
"**/node_modules/**"
|
|
158
|
-
],
|
|
159
|
-
"rewrites": [
|
|
160
|
-
{
|
|
161
|
-
"source": "**",
|
|
162
|
-
"destination": "/index.html"
|
|
163
|
-
}
|
|
164
|
-
]
|
|
165
|
-
}
|
|
166
|
-
],
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
If you have multiple build targets and deploy targets, it is possible to specify them in your `angular.json` or `workspace.json`.
|
|
170
|
-
|
|
171
|
-
It is possible to use either your project name or project alias in `siteTarget`.
|
|
172
|
-
|
|
173
|
-
You may specify a `siteTarget` in your `options` as follows:
|
|
174
|
-
|
|
175
|
-
```json
|
|
176
|
-
"deploy": {
|
|
177
|
-
"builder": "@angular/fire:deploy",
|
|
178
|
-
"options": {
|
|
179
|
-
"buildTarget": "projectName:build",
|
|
180
|
-
"firebaseProject": "developmentProject",
|
|
181
|
-
"siteTarget": "yourDefaultSiteTarget"
|
|
182
|
-
},
|
|
183
|
-
"configurations": {
|
|
184
|
-
"production": {
|
|
185
|
-
"buildTarget": "projectName:build:production",
|
|
186
|
-
"firebaseProject": "productionProject",
|
|
187
|
-
"siteTarget": "yourProdSiteTarget"
|
|
188
|
-
},
|
|
189
|
-
"storybook": {
|
|
190
|
-
"buildTarget": "projectName:build-storybook",
|
|
191
|
-
"firebaseProject": "developmentProject",
|
|
192
|
-
"siteTarget": "yourStorybookSiteTarget"
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
```
|
|
197
|
-
|
|
198
|
-
The above configuration specifies the following:
|
|
199
|
-
|
|
200
|
-
1. `ng deploy` will deploy the default project with default configuration.
|
|
201
|
-
2. `ng deploy projectName` will deploy the specified project with default configuration.
|
|
202
|
-
3. `ng deploy projectName --configuration=storybook --siteTarget=mySiteTarget` will deploy `projectName` to `mySiteTarget` with configuration`storybook`.
|
|
203
|
-
|
|
204
|
-
All of the options are optional
|
package/docs/firebase.json
DELETED
package/docs/firestore.md
DELETED
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
<img align="right" width="30%" src="images/firestore-illo_1x.png">
|
|
2
|
-
|
|
3
|
-
<small>
|
|
4
|
-
<a href="https://github.com/angular/angularfire">AngularFire</a> ❱ <a href="../README.md#developer-guide">Developer Guide</a> ❱ Realtime Cloud Firestore
|
|
5
|
-
</small>
|
|
6
|
-
|
|
7
|
-
# Cloud Firestore
|
|
8
|
-
|
|
9
|
-
Cloud Firestore is a flexible, scalable NoSQL database for mobile, web, and server development from Firebase and Google Cloud. It keeps your data in sync across client apps through realtime listeners and offers offline support for mobile and web so you can build responsive apps that work regardless of network latency or Internet connectivity.
|
|
10
|
-
|
|
11
|
-
[Learn more](https://firebase.google.com/docs/firestore)
|
|
12
|
-
|
|
13
|
-
Cloud Firestore is the API that gives your application access to your database in the cloud or locally in your [emulator](https://firebase.google.com/docs/emulator-suite).
|
|
14
|
-
|
|
15
|
-
## Dependency Injection
|
|
16
|
-
|
|
17
|
-
As a prerequisite, ensure that `AngularFire` has been added to your project via
|
|
18
|
-
```bash
|
|
19
|
-
ng add @angular/fire
|
|
20
|
-
```
|
|
21
|
-
Provide a Firestore instance in the application's `NgModule` (`app.module.ts`):
|
|
22
|
-
|
|
23
|
-
```typescript
|
|
24
|
-
@NgModule({
|
|
25
|
-
declarations: [
|
|
26
|
-
...
|
|
27
|
-
],
|
|
28
|
-
imports: [
|
|
29
|
-
...
|
|
30
|
-
// App initialization
|
|
31
|
-
provideFirebaseApp(() => initializeApp(environment.firebase)),
|
|
32
|
-
provideFirestore(() => getFirestore())
|
|
33
|
-
],
|
|
34
|
-
providers: [],
|
|
35
|
-
bootstrap: [AppComponent]
|
|
36
|
-
})
|
|
37
|
-
export class AppModule { }
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
In your component class, for example `user-profile.component.ts` import and inject `Firestore`:
|
|
42
|
-
|
|
43
|
-
```typescript
|
|
44
|
-
import { Component, inject } from '@angular/core';
|
|
45
|
-
import { Firestore } from '@angular/fire/firestore';
|
|
46
|
-
|
|
47
|
-
@Component({
|
|
48
|
-
standalone: true,
|
|
49
|
-
selector: 'app-user-profile',
|
|
50
|
-
...
|
|
51
|
-
})
|
|
52
|
-
export class UserProfileComponent {
|
|
53
|
-
private firestore: Firestore = inject(Firestore);
|
|
54
|
-
...
|
|
55
|
-
}
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
## Firebase API
|
|
59
|
-
With the reference to Cloud Firestore available in a component it is now possible to connect read from and write to the database.
|
|
60
|
-
|
|
61
|
-
### Reading data
|
|
62
|
-
In Cloud Firestore data is stored in `documents` and `documents` are stored in `collections`. The path to data follows `<collection_name>/<document_id>` and continues if there are subcollections. For example, `"users/ABC1245/posts/XYZ6789"` represents:
|
|
63
|
-
* `users` collection
|
|
64
|
-
* document id `ABC12345`
|
|
65
|
-
* `posts` collection
|
|
66
|
-
* document id `XYZ6789`
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
Let's explore reading data in Angular using the `collection` and `collectionData` functions.
|
|
70
|
-
|
|
71
|
-
In `user-profile.component.ts`:
|
|
72
|
-
|
|
73
|
-
```typescript
|
|
74
|
-
import { Firestore, collection, collectionData} from '@angular/fire/firestore';
|
|
75
|
-
import { Component, inject } from '@angular/core';
|
|
76
|
-
|
|
77
|
-
@Component ({
|
|
78
|
-
selector: 'app-user-profile',
|
|
79
|
-
standalone: true,
|
|
80
|
-
...
|
|
81
|
-
})
|
|
82
|
-
export class UserProfileComponent {
|
|
83
|
-
private firestore: Firestore = inject(Firestore); // inject Cloud Firestore
|
|
84
|
-
users$: Observable<UserProfile[]>;
|
|
85
|
-
|
|
86
|
-
constructor() {
|
|
87
|
-
// get a reference to the user-profile collection
|
|
88
|
-
const userProfileCollection = collection(this.firestore, 'users');
|
|
89
|
-
|
|
90
|
-
// get documents (data) from the collection using collectionData
|
|
91
|
-
this.users$ = collectionData(userProfileCollection) as Observable<UserProfile[]>;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
export Interface UserProfile {
|
|
95
|
-
username: string;
|
|
96
|
-
}
|
|
97
|
-
```
|
|
98
|
-
`collectionData` returns an `observable` that can we can use to display the data in the template. In `user-profile.component.html`:
|
|
99
|
-
|
|
100
|
-
```html
|
|
101
|
-
<section>
|
|
102
|
-
<h1>User Profiles</h1>
|
|
103
|
-
<ul>
|
|
104
|
-
<li *ngFor="let user of users$ | async">
|
|
105
|
-
{{user.username}}
|
|
106
|
-
</li>
|
|
107
|
-
</ul>
|
|
108
|
-
</section>
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
The `async` pipe handles unsubscribing from observables.
|
|
112
|
-
|
|
113
|
-
### Writing data
|
|
114
|
-
To write to Cloud Firestore use the `addDoc` function. It will create a new document at the path specified by the collection. In `user-profile.component.ts`, we'll update the code to add a new document on a `<button>` click.
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
```typescript
|
|
118
|
-
import { Firestore, collection, collectionData, addDoc} from '@angular/fire/firestore';
|
|
119
|
-
import { Component, inject } from '@angular/core';
|
|
120
|
-
|
|
121
|
-
@Component ({
|
|
122
|
-
selector: 'app-user-profile',
|
|
123
|
-
standalone: true,
|
|
124
|
-
...
|
|
125
|
-
})
|
|
126
|
-
export class UserProfileComponent {
|
|
127
|
-
private firestore: Firestore = inject(Firestore); // inject Cloud Firestore
|
|
128
|
-
users$: Observable<UserProfile[]>;
|
|
129
|
-
usersCollection: CollectionReference;
|
|
130
|
-
|
|
131
|
-
constructor() {...}
|
|
132
|
-
|
|
133
|
-
addUserProfile(username: string) {
|
|
134
|
-
if (!username) return;
|
|
135
|
-
|
|
136
|
-
addDoc(this.usersCollection, <UserProfile> { username }).then((documentReference: DocumentReference) => {
|
|
137
|
-
// the documentReference provides access to the newly created document
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
export Interface UserProfile {
|
|
142
|
-
username: string;
|
|
143
|
-
}
|
|
144
|
-
```
|
|
145
|
-
In the `addUserProfile` method we use a reference to the `this.usersCollection` and provide `UserProfile` data to the the `addDoc` function. `addDoc` returns a promise that can be used to respond to the successful addition of the data. Errors can also be caught here.
|
|
146
|
-
|
|
147
|
-
## Learn More
|
|
148
|
-
More information on API methods and other functions can be found on the [Firebase Official Docs](https://firebase.google.com/docs/reference/js/firestore_)
|
package/docs/functions.md
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
<img align="right" width="30%" src="images/functions-illo_1x.png">
|
|
2
|
-
|
|
3
|
-
<small>
|
|
4
|
-
<a href="https://github.com/angular/angularfire">AngularFire</a> ❱ <a href="../README.md#developer-guide">Developer Guide</a> ❱ Realtime Cloud Functions
|
|
5
|
-
</small>
|
|
6
|
-
|
|
7
|
-
# Cloud Functions
|
|
8
|
-
|
|
9
|
-
The Cloud Functions for Firebase client SDKs let you call functions directly from a Firebase app. To call a function from your app in this way, write and deploy an HTTPS Callable function in Cloud Functions, and then add client logic to call the function from your app.
|
|
10
|
-
|
|
11
|
-
[Learn More](https://firebase.google.com/docs/functions/get-started)
|
|
12
|
-
|
|
13
|
-
## Dependency Injection
|
|
14
|
-
|
|
15
|
-
As a prerequisite, ensure that `AngularFire` has been added to your project via
|
|
16
|
-
```bash
|
|
17
|
-
ng add @angular/fire
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
Provide a Cloud Functions instance in the application's `NgModule` (`app.module.ts`):
|
|
21
|
-
|
|
22
|
-
```ts
|
|
23
|
-
import { provideFirebaseApp, initializeApp } from '@angular/fire/app';
|
|
24
|
-
import { getFunctions, provideFunctions } from '@angular/fire/functions';
|
|
25
|
-
|
|
26
|
-
@NgModule({
|
|
27
|
-
imports: [
|
|
28
|
-
provideFirebaseApp(() => initializeApp(environment.firebase)),
|
|
29
|
-
provideFunctions(() => getFunctions()),
|
|
30
|
-
]
|
|
31
|
-
})
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
Next inject it into your component:
|
|
35
|
-
|
|
36
|
-
```ts
|
|
37
|
-
import { Component, inject} from '@angular/core';
|
|
38
|
-
import { Functions } from '@angular/fire/functions';
|
|
39
|
-
|
|
40
|
-
@Component({ ... })
|
|
41
|
-
export class AppComponent {
|
|
42
|
-
private functions: Functions = inject(Functions);
|
|
43
|
-
...
|
|
44
|
-
}
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## Firebase API
|
|
48
|
-
The [Firebase API for Cloud Functions documentation](https://firebase.google.com/docs/reference/js/functions) is available on the Firebase website.
|
|
49
|
-
|
|
50
|
-
## Convenience observables
|
|
51
|
-
|
|
52
|
-
More details coming soon.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|