@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.
Files changed (466) hide show
  1. package/analytics/is-analytics-supported-factory.d.ts +4 -0
  2. package/app-check/app-check.d.ts +0 -6
  3. package/app-check/app-check.module.d.ts +0 -1
  4. package/app-check/public_api.d.ts +2 -1
  5. package/auth-guard/auth-guard.d.ts +4 -4
  6. package/compat/auth/auth.d.ts +1 -1
  7. package/compat/auth-guard/auth-guard.d.ts +6 -4
  8. package/compat/database/interfaces.d.ts +12 -12
  9. package/compat/firestore/interfaces.d.ts +17 -17
  10. package/compat/proxy.d.ts +8 -8
  11. package/compat/remote-config/interfaces.d.ts +1 -1
  12. package/compat/storage/interfaces.d.ts +8 -8
  13. package/compat/storage/pipes/storageUrl.pipe.d.ts +1 -1
  14. package/core.d.ts +8 -12
  15. package/esm2022/analytics/analytics.module.mjs +94 -0
  16. package/esm2022/analytics/is-analytics-supported-factory.mjs +16 -0
  17. package/esm2022/analytics/overrides.mjs +3 -0
  18. package/esm2022/analytics/screen-tracking.service.mjs +147 -0
  19. package/esm2022/analytics/user-tracking.service.mjs +44 -0
  20. package/esm2022/app/app.module.mjs +84 -0
  21. package/esm2022/app-check/app-check.mjs +10 -0
  22. package/esm2022/app-check/app-check.module.mjs +79 -0
  23. package/esm2022/app-check/public_api.mjs +5 -0
  24. package/esm2022/auth/auth.module.mjs +71 -0
  25. package/esm2022/auth-guard/auth-guard.mjs +51 -0
  26. package/{esm2015/auth-guard/auth-guard.module.js → esm2022/auth-guard/auth-guard.module.mjs} +5 -5
  27. package/esm2022/compat/analytics/analytics.mjs +161 -0
  28. package/{esm2015/compat/analytics/analytics.module.js → esm2022/compat/analytics/analytics.module.mjs} +5 -5
  29. package/esm2022/compat/analytics/screen-tracking.service.mjs +49 -0
  30. package/esm2022/compat/analytics/user-tracking.service.mjs +53 -0
  31. package/esm2022/compat/auth/auth.mjs +161 -0
  32. package/{esm2015/compat/auth/auth.module.js → esm2022/compat/auth/auth.module.mjs} +5 -5
  33. package/{esm2015/compat/auth/public_api.js → esm2022/compat/auth/public_api.mjs} +1 -1
  34. package/esm2022/compat/auth-guard/auth-guard.mjs +51 -0
  35. package/{esm2015/compat/auth-guard/auth-guard.module.js → esm2022/compat/auth-guard/auth-guard.module.mjs} +5 -5
  36. package/{esm2015/compat/cache.js → esm2022/compat/cache.mjs} +3 -3
  37. package/esm2022/compat/database/database.mjs +119 -0
  38. package/{esm2015/compat/database/database.module.js → esm2022/compat/database/database.module.mjs} +5 -5
  39. package/esm2022/compat/database/list/create-reference.mjs +44 -0
  40. package/{esm2015/compat/firebase.app.module.js → esm2022/compat/firebase.app.module.mjs} +11 -11
  41. package/esm2022/compat/firestore/collection/changes.mjs +108 -0
  42. package/esm2022/compat/firestore/collection/collection.mjs +123 -0
  43. package/esm2022/compat/firestore/collection-group/collection-group.mjs +86 -0
  44. package/esm2022/compat/firestore/document/document.mjs +87 -0
  45. package/esm2022/compat/firestore/firestore.mjs +257 -0
  46. package/{esm2015/compat/firestore/firestore.module.js → esm2022/compat/firestore/firestore.module.mjs} +5 -5
  47. package/esm2022/compat/firestore/interfaces.mjs +2 -0
  48. package/esm2022/compat/firestore/observable/fromRef.mjs +40 -0
  49. package/esm2022/compat/functions/functions.mjs +69 -0
  50. package/{esm2015/compat/functions/functions.module.js → esm2022/compat/functions/functions.module.mjs} +5 -5
  51. package/{esm2015/compat/functions/public_api.js → esm2022/compat/functions/public_api.mjs} +1 -1
  52. package/esm2022/compat/messaging/messaging.mjs +80 -0
  53. package/{esm2015/compat/messaging/messaging.module.js → esm2022/compat/messaging/messaging.module.mjs} +5 -5
  54. package/{esm2015/compat/performance/performance.js → esm2022/compat/performance/performance.mjs} +7 -6
  55. package/{esm2015/compat/performance/performance.module.js → esm2022/compat/performance/performance.module.mjs} +5 -5
  56. package/esm2022/compat/performance/performance.service.mjs +27 -0
  57. package/esm2022/compat/proxy.mjs +59 -0
  58. package/esm2022/compat/remote-config/remote-config.mjs +207 -0
  59. package/{esm2015/compat/remote-config/remote-config.module.js → esm2022/compat/remote-config/remote-config.module.mjs} +5 -5
  60. package/esm2022/compat/storage/pipes/storageUrl.pipe.mjs +58 -0
  61. package/esm2022/compat/storage/storage.mjs +95 -0
  62. package/{esm2015/compat/storage/storage.module.js → esm2022/compat/storage/storage.module.mjs} +5 -5
  63. package/esm2022/core.mjs +45 -0
  64. package/esm2022/database/database.module.mjs +74 -0
  65. package/esm2022/firestore/firestore.module.mjs +74 -0
  66. package/esm2022/firestore/lite/lite.module.mjs +73 -0
  67. package/esm2022/firestore/rxfire.mjs +15 -0
  68. package/esm2022/functions/functions.module.mjs +74 -0
  69. package/esm2022/messaging/is-messaging-supported-factory.mjs +16 -0
  70. package/esm2022/messaging/messaging.module.mjs +86 -0
  71. package/esm2022/messaging/overrides.mjs +3 -0
  72. package/{esm2015/performance/performance.module.js → esm2022/performance/performance.module.mjs} +8 -8
  73. package/esm2022/remote-config/is-remote-config-supported-factory.mjs +16 -0
  74. package/esm2022/remote-config/overrides.mjs +3 -0
  75. package/esm2022/remote-config/remote-config.module.mjs +86 -0
  76. package/esm2022/storage/storage.module.mjs +74 -0
  77. package/esm2022/zones.mjs +196 -0
  78. package/{fesm2015/angular-fire-analytics.js → fesm2022/angular-fire-analytics.mjs} +61 -38
  79. package/fesm2022/angular-fire-analytics.mjs.map +1 -0
  80. package/{fesm2015/angular-fire-app-check.js → fesm2022/angular-fire-app-check.mjs} +15 -22
  81. package/fesm2022/angular-fire-app-check.mjs.map +1 -0
  82. package/{fesm2015/angular-fire-app.js → fesm2022/angular-fire-app.mjs} +8 -8
  83. package/fesm2022/angular-fire-app.mjs.map +1 -0
  84. package/{fesm2015/angular-fire-auth-guard.js → fesm2022/angular-fire-auth-guard.mjs} +25 -23
  85. package/fesm2022/angular-fire-auth-guard.mjs.map +1 -0
  86. package/{fesm2015/angular-fire-auth.js → fesm2022/angular-fire-auth.mjs} +10 -11
  87. package/fesm2022/angular-fire-auth.mjs.map +1 -0
  88. package/{fesm2015/angular-fire-compat-analytics.js → fesm2022/angular-fire-compat-analytics.mjs} +28 -28
  89. package/fesm2022/angular-fire-compat-analytics.mjs.map +1 -0
  90. package/{fesm2015/angular-fire-compat-auth-guard.js → fesm2022/angular-fire-compat-auth-guard.mjs} +25 -23
  91. package/fesm2022/angular-fire-compat-auth-guard.mjs.map +1 -0
  92. package/{fesm2015/angular-fire-compat-auth.js → fesm2022/angular-fire-compat-auth.mjs} +32 -10
  93. package/fesm2022/angular-fire-compat-auth.mjs.map +1 -0
  94. package/{fesm2015/angular-fire-compat-database.js → fesm2022/angular-fire-compat-database.mjs} +17 -12
  95. package/fesm2022/angular-fire-compat-database.mjs.map +1 -0
  96. package/{fesm2015/angular-fire-compat-firestore.js → fesm2022/angular-fire-compat-firestore.mjs} +37 -16
  97. package/fesm2022/angular-fire-compat-firestore.mjs.map +1 -0
  98. package/{fesm2015/angular-fire-compat-functions.js → fesm2022/angular-fire-compat-functions.mjs} +10 -9
  99. package/fesm2022/angular-fire-compat-functions.mjs.map +1 -0
  100. package/{fesm2015/angular-fire-compat-messaging.js → fesm2022/angular-fire-compat-messaging.mjs} +20 -15
  101. package/fesm2022/angular-fire-compat-messaging.mjs.map +1 -0
  102. package/{fesm2015/angular-fire-compat-performance.js → fesm2022/angular-fire-compat-performance.mjs} +16 -15
  103. package/fesm2022/angular-fire-compat-performance.mjs.map +1 -0
  104. package/{fesm2015/angular-fire-compat-remote-config.js → fesm2022/angular-fire-compat-remote-config.mjs} +33 -19
  105. package/fesm2022/angular-fire-compat-remote-config.mjs.map +1 -0
  106. package/{fesm2015/angular-fire-compat-storage.js → fesm2022/angular-fire-compat-storage.mjs} +23 -18
  107. package/fesm2022/angular-fire-compat-storage.mjs.map +1 -0
  108. package/{fesm2015/angular-fire-compat.js → fesm2022/angular-fire-compat.mjs} +15 -17
  109. package/fesm2022/angular-fire-compat.mjs.map +1 -0
  110. package/{fesm2015/angular-fire-database.js → fesm2022/angular-fire-database.mjs} +10 -11
  111. package/fesm2022/angular-fire-database.mjs.map +1 -0
  112. package/{fesm2015/angular-fire-firestore-lite.js → fesm2022/angular-fire-firestore-lite.mjs} +10 -11
  113. package/fesm2022/angular-fire-firestore-lite.mjs.map +1 -0
  114. package/{fesm2015/angular-fire-firestore.js → fesm2022/angular-fire-firestore.mjs} +14 -13
  115. package/fesm2022/angular-fire-firestore.mjs.map +1 -0
  116. package/{fesm2015/angular-fire-functions.js → fesm2022/angular-fire-functions.mjs} +10 -11
  117. package/fesm2022/angular-fire-functions.mjs.map +1 -0
  118. package/{fesm2015/angular-fire-messaging.js → fesm2022/angular-fire-messaging.mjs} +33 -19
  119. package/fesm2022/angular-fire-messaging.mjs.map +1 -0
  120. package/{fesm2015/angular-fire-performance.js → fesm2022/angular-fire-performance.mjs} +8 -8
  121. package/fesm2022/angular-fire-performance.mjs.map +1 -0
  122. package/{fesm2015/angular-fire-remote-config.js → fesm2022/angular-fire-remote-config.mjs} +34 -20
  123. package/fesm2022/angular-fire-remote-config.mjs.map +1 -0
  124. package/{fesm2015/angular-fire-storage.js → fesm2022/angular-fire-storage.mjs} +10 -11
  125. package/fesm2022/angular-fire-storage.mjs.map +1 -0
  126. package/{fesm2015/angular-fire.js → fesm2022/angular-fire.mjs} +31 -52
  127. package/fesm2022/angular-fire.mjs.map +1 -0
  128. package/firestore/rxfire.d.ts +3 -1
  129. package/messaging/is-messaging-supported-factory.d.ts +4 -0
  130. package/package.json +158 -7
  131. package/publish.sh +1 -0
  132. package/remote-config/is-remote-config-supported-factory.d.ts +4 -0
  133. package/schematics/add/index.js +1 -1
  134. package/schematics/common.js +8 -4
  135. package/schematics/deploy/actions.js +59 -59
  136. package/schematics/deploy/builder.js +5 -5
  137. package/schematics/firebaseTools.js +9 -5
  138. package/schematics/setup/index.js +24 -23
  139. package/schematics/setup/prompts.js +20 -15
  140. package/schematics/update/v7/index.js +5 -5
  141. package/schematics/utils.js +30 -30
  142. package/README.md +0 -216
  143. package/analytics/package.json +0 -11
  144. package/app/package.json +0 -11
  145. package/app-check/package.json +0 -11
  146. package/auth/package.json +0 -11
  147. package/auth-guard/package.json +0 -11
  148. package/bundles/angular-fire-analytics.umd.js +0 -673
  149. package/bundles/angular-fire-analytics.umd.js.map +0 -1
  150. package/bundles/angular-fire-app-check.umd.js +0 -465
  151. package/bundles/angular-fire-app-check.umd.js.map +0 -1
  152. package/bundles/angular-fire-app.umd.js +0 -477
  153. package/bundles/angular-fire-app.umd.js.map +0 -1
  154. package/bundles/angular-fire-auth-guard.umd.js +0 -109
  155. package/bundles/angular-fire-auth-guard.umd.js.map +0 -1
  156. package/bundles/angular-fire-auth.umd.js +0 -557
  157. package/bundles/angular-fire-auth.umd.js.map +0 -1
  158. package/bundles/angular-fire-compat-analytics.umd.js +0 -672
  159. package/bundles/angular-fire-compat-analytics.umd.js.map +0 -1
  160. package/bundles/angular-fire-compat-auth-guard.umd.js +0 -112
  161. package/bundles/angular-fire-compat-auth-guard.umd.js.map +0 -1
  162. package/bundles/angular-fire-compat-auth.umd.js +0 -559
  163. package/bundles/angular-fire-compat-auth.umd.js.map +0 -1
  164. package/bundles/angular-fire-compat-database.umd.js +0 -799
  165. package/bundles/angular-fire-compat-database.umd.js.map +0 -1
  166. package/bundles/angular-fire-compat-firestore.umd.js +0 -1073
  167. package/bundles/angular-fire-compat-firestore.umd.js.map +0 -1
  168. package/bundles/angular-fire-compat-functions.umd.js +0 -443
  169. package/bundles/angular-fire-compat-functions.umd.js.map +0 -1
  170. package/bundles/angular-fire-compat-messaging.umd.js +0 -465
  171. package/bundles/angular-fire-compat-messaging.umd.js.map +0 -1
  172. package/bundles/angular-fire-compat-performance.umd.js +0 -212
  173. package/bundles/angular-fire-compat-performance.umd.js.map +0 -1
  174. package/bundles/angular-fire-compat-remote-config.umd.js +0 -605
  175. package/bundles/angular-fire-compat-remote-config.umd.js.map +0 -1
  176. package/bundles/angular-fire-compat-storage.umd.js +0 -598
  177. package/bundles/angular-fire-compat-storage.umd.js.map +0 -1
  178. package/bundles/angular-fire-compat.umd.js +0 -535
  179. package/bundles/angular-fire-compat.umd.js.map +0 -1
  180. package/bundles/angular-fire-database.umd.js +0 -557
  181. package/bundles/angular-fire-database.umd.js.map +0 -1
  182. package/bundles/angular-fire-firestore-lite.umd.js +0 -531
  183. package/bundles/angular-fire-firestore-lite.umd.js.map +0 -1
  184. package/bundles/angular-fire-firestore.umd.js +0 -565
  185. package/bundles/angular-fire-firestore.umd.js.map +0 -1
  186. package/bundles/angular-fire-functions.umd.js +0 -461
  187. package/bundles/angular-fire-functions.umd.js.map +0 -1
  188. package/bundles/angular-fire-messaging.umd.js +0 -473
  189. package/bundles/angular-fire-messaging.umd.js.map +0 -1
  190. package/bundles/angular-fire-performance.umd.js +0 -473
  191. package/bundles/angular-fire-performance.umd.js.map +0 -1
  192. package/bundles/angular-fire-remote-config.umd.js +0 -499
  193. package/bundles/angular-fire-remote-config.umd.js.map +0 -1
  194. package/bundles/angular-fire-storage.umd.js +0 -485
  195. package/bundles/angular-fire-storage.umd.js.map +0 -1
  196. package/bundles/angular-fire.umd.js +0 -308
  197. package/bundles/angular-fire.umd.js.map +0 -1
  198. package/compat/analytics/package.json +0 -11
  199. package/compat/auth/package.json +0 -11
  200. package/compat/auth-guard/package.json +0 -11
  201. package/compat/database/package.json +0 -11
  202. package/compat/firestore/package.json +0 -11
  203. package/compat/functions/package.json +0 -11
  204. package/compat/messaging/package.json +0 -11
  205. package/compat/package.json +0 -11
  206. package/compat/performance/package.json +0 -11
  207. package/compat/remote-config/package.json +0 -11
  208. package/compat/storage/package.json +0 -11
  209. package/database/package.json +0 -11
  210. package/docs/analytics.md +0 -67
  211. package/docs/app-check.md +0 -53
  212. package/docs/auth.md +0 -165
  213. package/docs/compat/analytics/getting-started.md +0 -137
  214. package/docs/compat/auth/getting-started.md +0 -162
  215. package/docs/compat/auth/router-guards.md +0 -104
  216. package/docs/compat/emulators/emulators.md +0 -134
  217. package/docs/compat/firestore/collections.md +0 -326
  218. package/docs/compat/firestore/documents.md +0 -115
  219. package/docs/compat/firestore/offline-data.md +0 -39
  220. package/docs/compat/firestore/querying-collections.md +0 -204
  221. package/docs/compat/functions/functions.md +0 -166
  222. package/docs/compat/messaging/messaging.md +0 -232
  223. package/docs/compat/performance/getting-started.md +0 -132
  224. package/docs/compat/remote-config/getting-started.md +0 -134
  225. package/docs/compat/rtdb/lists.md +0 -257
  226. package/docs/compat/rtdb/objects.md +0 -182
  227. package/docs/compat/rtdb/querying-lists.md +0 -155
  228. package/docs/compat/storage/storage.md +0 -257
  229. package/docs/compat.md +0 -70
  230. package/docs/database.md +0 -175
  231. package/docs/deploy/getting-started.md +0 -204
  232. package/docs/firebase.json +0 -16
  233. package/docs/firestore.md +0 -148
  234. package/docs/functions.md +0 -52
  235. package/docs/images/analytics-illo_1x.png +0 -0
  236. package/docs/images/auth-illo_1x.png +0 -0
  237. package/docs/images/cloud-messaging-illo_1x.png +0 -0
  238. package/docs/images/database-illo_1x.png +0 -0
  239. package/docs/images/firestore-illo_1x.png +0 -0
  240. package/docs/images/functions-illo_1x.png +0 -0
  241. package/docs/images/hosting-illo_1x.png +0 -0
  242. package/docs/images/performance-illo_1x.png +0 -0
  243. package/docs/images/reCAPTCHA-logo@1x.png +0 -0
  244. package/docs/images/remote-config-illo_1x.png +0 -0
  245. package/docs/images/storage-illo_1x.png +0 -0
  246. package/docs/install-and-setup.md +0 -114
  247. package/docs/install-angular-cli-windows10.md +0 -82
  248. package/docs/messaging.md +0 -25
  249. package/docs/performance.md +0 -57
  250. package/docs/remote-config.md +0 -53
  251. package/docs/storage.md +0 -90
  252. package/docs/universal/cloud-functions.md +0 -75
  253. package/docs/universal/getting-started.md +0 -153
  254. package/docs/universal/prerendering.md +0 -72
  255. package/docs/version-4-upgrade.md +0 -119
  256. package/docs/version-5-upgrade.md +0 -82
  257. package/docs/version-6-upgrade.md +0 -16
  258. package/docs/version-7-upgrade.md +0 -298
  259. package/esm2015/analytics/analytics.module.js +0 -93
  260. package/esm2015/analytics/overrides.js +0 -3
  261. package/esm2015/analytics/screen-tracking.service.js +0 -139
  262. package/esm2015/analytics/user-tracking.service.js +0 -43
  263. package/esm2015/app/app.module.js +0 -84
  264. package/esm2015/app-check/app-check.js +0 -16
  265. package/esm2015/app-check/app-check.module.js +0 -81
  266. package/esm2015/app-check/public_api.js +0 -4
  267. package/esm2015/auth/auth.module.js +0 -71
  268. package/esm2015/auth-guard/auth-guard.js +0 -49
  269. package/esm2015/compat/analytics/analytics.js +0 -163
  270. package/esm2015/compat/analytics/screen-tracking.service.js +0 -49
  271. package/esm2015/compat/analytics/user-tracking.service.js +0 -52
  272. package/esm2015/compat/auth/auth.js +0 -139
  273. package/esm2015/compat/auth-guard/auth-guard.js +0 -49
  274. package/esm2015/compat/database/database.js +0 -117
  275. package/esm2015/compat/database/list/create-reference.js +0 -41
  276. package/esm2015/compat/firestore/collection/changes.js +0 -107
  277. package/esm2015/compat/firestore/collection/collection.js +0 -117
  278. package/esm2015/compat/firestore/collection-group/collection-group.js +0 -81
  279. package/esm2015/compat/firestore/document/document.js +0 -82
  280. package/esm2015/compat/firestore/firestore.js +0 -254
  281. package/esm2015/compat/firestore/interfaces.js +0 -2
  282. package/esm2015/compat/firestore/observable/fromRef.js +0 -39
  283. package/esm2015/compat/functions/functions.js +0 -68
  284. package/esm2015/compat/messaging/messaging.js +0 -75
  285. package/esm2015/compat/performance/performance.service.js +0 -27
  286. package/esm2015/compat/proxy.js +0 -61
  287. package/esm2015/compat/remote-config/remote-config.js +0 -193
  288. package/esm2015/compat/storage/pipes/storageUrl.pipe.js +0 -54
  289. package/esm2015/compat/storage/storage.js +0 -94
  290. package/esm2015/core.js +0 -79
  291. package/esm2015/database/database.module.js +0 -74
  292. package/esm2015/firestore/firestore.module.js +0 -74
  293. package/esm2015/firestore/lite/lite.module.js +0 -74
  294. package/esm2015/firestore/rxfire.js +0 -13
  295. package/esm2015/functions/functions.module.js +0 -74
  296. package/esm2015/messaging/messaging.module.js +0 -85
  297. package/esm2015/messaging/overrides.js +0 -3
  298. package/esm2015/remote-config/overrides.js +0 -3
  299. package/esm2015/remote-config/remote-config.module.js +0 -85
  300. package/esm2015/storage/storage.module.js +0 -74
  301. package/esm2015/zones.js +0 -183
  302. package/fesm2015/angular-fire-analytics.js.map +0 -1
  303. package/fesm2015/angular-fire-app-check.js.map +0 -1
  304. package/fesm2015/angular-fire-app.js.map +0 -1
  305. package/fesm2015/angular-fire-auth-guard.js.map +0 -1
  306. package/fesm2015/angular-fire-auth.js.map +0 -1
  307. package/fesm2015/angular-fire-compat-analytics.js.map +0 -1
  308. package/fesm2015/angular-fire-compat-auth-guard.js.map +0 -1
  309. package/fesm2015/angular-fire-compat-auth.js.map +0 -1
  310. package/fesm2015/angular-fire-compat-database.js.map +0 -1
  311. package/fesm2015/angular-fire-compat-firestore.js.map +0 -1
  312. package/fesm2015/angular-fire-compat-functions.js.map +0 -1
  313. package/fesm2015/angular-fire-compat-messaging.js.map +0 -1
  314. package/fesm2015/angular-fire-compat-performance.js.map +0 -1
  315. package/fesm2015/angular-fire-compat-remote-config.js.map +0 -1
  316. package/fesm2015/angular-fire-compat-storage.js.map +0 -1
  317. package/fesm2015/angular-fire-compat.js.map +0 -1
  318. package/fesm2015/angular-fire-database.js.map +0 -1
  319. package/fesm2015/angular-fire-firestore-lite.js.map +0 -1
  320. package/fesm2015/angular-fire-firestore.js.map +0 -1
  321. package/fesm2015/angular-fire-functions.js.map +0 -1
  322. package/fesm2015/angular-fire-messaging.js.map +0 -1
  323. package/fesm2015/angular-fire-performance.js.map +0 -1
  324. package/fesm2015/angular-fire-remote-config.js.map +0 -1
  325. package/fesm2015/angular-fire-storage.js.map +0 -1
  326. package/fesm2015/angular-fire.js.map +0 -1
  327. package/firestore/lite/package.json +0 -11
  328. package/firestore/package.json +0 -11
  329. package/firestore-protos.js +0 -4
  330. package/functions/package.json +0 -11
  331. package/messaging/package.json +0 -11
  332. package/performance/package.json +0 -11
  333. package/remote-config/package.json +0 -11
  334. package/schematics/add/schema.json +0 -16
  335. package/schematics/builders.json +0 -10
  336. package/schematics/collection.json +0 -15
  337. package/schematics/deploy/schema.json +0 -119
  338. package/schematics/migration.json +0 -15
  339. package/schematics/setup/schema.json +0 -16
  340. package/storage/package.json +0 -11
  341. /package/analytics/{angular-fire-analytics.d.ts → index.d.ts} +0 -0
  342. /package/app/{angular-fire-app.d.ts → index.d.ts} +0 -0
  343. /package/app-check/{angular-fire-app-check.d.ts → index.d.ts} +0 -0
  344. /package/auth/{angular-fire-auth.d.ts → index.d.ts} +0 -0
  345. /package/auth-guard/{angular-fire-auth-guard.d.ts → index.d.ts} +0 -0
  346. /package/compat/analytics/{angular-fire-compat-analytics.d.ts → index.d.ts} +0 -0
  347. /package/compat/auth/{angular-fire-compat-auth.d.ts → index.d.ts} +0 -0
  348. /package/compat/auth-guard/{angular-fire-compat-auth-guard.d.ts → index.d.ts} +0 -0
  349. /package/compat/database/{angular-fire-compat-database.d.ts → index.d.ts} +0 -0
  350. /package/compat/firestore/{angular-fire-compat-firestore.d.ts → index.d.ts} +0 -0
  351. /package/compat/functions/{angular-fire-compat-functions.d.ts → index.d.ts} +0 -0
  352. /package/compat/{angular-fire-compat.d.ts → index.d.ts} +0 -0
  353. /package/compat/messaging/{angular-fire-compat-messaging.d.ts → index.d.ts} +0 -0
  354. /package/compat/performance/{angular-fire-compat-performance.d.ts → index.d.ts} +0 -0
  355. /package/compat/remote-config/{angular-fire-compat-remote-config.d.ts → index.d.ts} +0 -0
  356. /package/compat/storage/{angular-fire-compat-storage.d.ts → index.d.ts} +0 -0
  357. /package/database/{angular-fire-database.d.ts → index.d.ts} +0 -0
  358. /package/{esm2015/analytics/analytics.js → esm2022/analytics/analytics.mjs} +0 -0
  359. /package/{esm2015/analytics/angular-fire-analytics.js → esm2022/analytics/angular-fire-analytics.mjs} +0 -0
  360. /package/{esm2015/analytics/firebase.js → esm2022/analytics/firebase.mjs} +0 -0
  361. /package/{esm2015/analytics/public_api.js → esm2022/analytics/public_api.mjs} +0 -0
  362. /package/{esm2015/angular-fire.js → esm2022/angular-fire.mjs} +0 -0
  363. /package/{esm2015/app/angular-fire-app.js → esm2022/app/angular-fire-app.mjs} +0 -0
  364. /package/{esm2015/app/app.js → esm2022/app/app.mjs} +0 -0
  365. /package/{esm2015/app/firebase.js → esm2022/app/firebase.mjs} +0 -0
  366. /package/{esm2015/app/public_api.js → esm2022/app/public_api.mjs} +0 -0
  367. /package/{esm2015/app-check/angular-fire-app-check.js → esm2022/app-check/angular-fire-app-check.mjs} +0 -0
  368. /package/{esm2015/app-check/firebase.js → esm2022/app-check/firebase.mjs} +0 -0
  369. /package/{esm2015/auth/angular-fire-auth.js → esm2022/auth/angular-fire-auth.mjs} +0 -0
  370. /package/{esm2015/auth/auth.js → esm2022/auth/auth.mjs} +0 -0
  371. /package/{esm2015/auth/firebase.js → esm2022/auth/firebase.mjs} +0 -0
  372. /package/{esm2015/auth/public_api.js → esm2022/auth/public_api.mjs} +0 -0
  373. /package/{esm2015/auth/rxfire.js → esm2022/auth/rxfire.mjs} +0 -0
  374. /package/{esm2015/auth-guard/angular-fire-auth-guard.js → esm2022/auth-guard/angular-fire-auth-guard.mjs} +0 -0
  375. /package/{esm2015/auth-guard/public_api.js → esm2022/auth-guard/public_api.mjs} +0 -0
  376. /package/{esm2015/compat/analytics/angular-fire-compat-analytics.js → esm2022/compat/analytics/angular-fire-compat-analytics.mjs} +0 -0
  377. /package/{esm2015/compat/analytics/base.js → esm2022/compat/analytics/base.mjs} +0 -0
  378. /package/{esm2015/compat/analytics/public_api.js → esm2022/compat/analytics/public_api.mjs} +0 -0
  379. /package/{esm2015/compat/angular-fire-compat.js → esm2022/compat/angular-fire-compat.mjs} +0 -0
  380. /package/{esm2015/compat/auth/angular-fire-compat-auth.js → esm2022/compat/auth/angular-fire-compat-auth.mjs} +0 -0
  381. /package/{esm2015/compat/auth/base.js → esm2022/compat/auth/base.mjs} +0 -0
  382. /package/{esm2015/compat/auth-guard/angular-fire-compat-auth-guard.js → esm2022/compat/auth-guard/angular-fire-compat-auth-guard.mjs} +0 -0
  383. /package/{esm2015/compat/auth-guard/public_api.js → esm2022/compat/auth-guard/public_api.mjs} +0 -0
  384. /package/{esm2015/compat/database/angular-fire-compat-database.js → esm2022/compat/database/angular-fire-compat-database.mjs} +0 -0
  385. /package/{esm2015/compat/database/interfaces.js → esm2022/compat/database/interfaces.mjs} +0 -0
  386. /package/{esm2015/compat/database/list/audit-trail.js → esm2022/compat/database/list/audit-trail.mjs} +0 -0
  387. /package/{esm2015/compat/database/list/changes.js → esm2022/compat/database/list/changes.mjs} +0 -0
  388. /package/{esm2015/compat/database/list/data-operation.js → esm2022/compat/database/list/data-operation.mjs} +0 -0
  389. /package/{esm2015/compat/database/list/remove.js → esm2022/compat/database/list/remove.mjs} +0 -0
  390. /package/{esm2015/compat/database/list/snapshot-changes.js → esm2022/compat/database/list/snapshot-changes.mjs} +0 -0
  391. /package/{esm2015/compat/database/list/state-changes.js → esm2022/compat/database/list/state-changes.mjs} +0 -0
  392. /package/{esm2015/compat/database/list/utils.js → esm2022/compat/database/list/utils.mjs} +0 -0
  393. /package/{esm2015/compat/database/object/create-reference.js → esm2022/compat/database/object/create-reference.mjs} +0 -0
  394. /package/{esm2015/compat/database/object/snapshot-changes.js → esm2022/compat/database/object/snapshot-changes.mjs} +0 -0
  395. /package/{esm2015/compat/database/observable/fromRef.js → esm2022/compat/database/observable/fromRef.mjs} +0 -0
  396. /package/{esm2015/compat/database/public_api.js → esm2022/compat/database/public_api.mjs} +0 -0
  397. /package/{esm2015/compat/database/utils.js → esm2022/compat/database/utils.mjs} +0 -0
  398. /package/{esm2015/compat/firebase.app.js → esm2022/compat/firebase.app.mjs} +0 -0
  399. /package/{esm2015/compat/firestore/angular-fire-compat-firestore.js → esm2022/compat/firestore/angular-fire-compat-firestore.mjs} +0 -0
  400. /package/{esm2015/compat/firestore/public_api.js → esm2022/compat/firestore/public_api.mjs} +0 -0
  401. /package/{esm2015/compat/functions/angular-fire-compat-functions.js → esm2022/compat/functions/angular-fire-compat-functions.mjs} +0 -0
  402. /package/{esm2015/compat/functions/base.js → esm2022/compat/functions/base.mjs} +0 -0
  403. /package/{esm2015/compat/messaging/angular-fire-compat-messaging.js → esm2022/compat/messaging/angular-fire-compat-messaging.mjs} +0 -0
  404. /package/{esm2015/compat/messaging/base.js → esm2022/compat/messaging/base.mjs} +0 -0
  405. /package/{esm2015/compat/messaging/public_api.js → esm2022/compat/messaging/public_api.mjs} +0 -0
  406. /package/{esm2015/compat/performance/angular-fire-compat-performance.js → esm2022/compat/performance/angular-fire-compat-performance.mjs} +0 -0
  407. /package/{esm2015/compat/performance/base.js → esm2022/compat/performance/base.mjs} +0 -0
  408. /package/{esm2015/compat/performance/public_api.js → esm2022/compat/performance/public_api.mjs} +0 -0
  409. /package/{esm2015/compat/public_api.js → esm2022/compat/public_api.mjs} +0 -0
  410. /package/{esm2015/compat/remote-config/angular-fire-compat-remote-config.js → esm2022/compat/remote-config/angular-fire-compat-remote-config.mjs} +0 -0
  411. /package/{esm2015/compat/remote-config/base.js → esm2022/compat/remote-config/base.mjs} +0 -0
  412. /package/{esm2015/compat/remote-config/interfaces.js → esm2022/compat/remote-config/interfaces.mjs} +0 -0
  413. /package/{esm2015/compat/remote-config/public_api.js → esm2022/compat/remote-config/public_api.mjs} +0 -0
  414. /package/{esm2015/compat/storage/angular-fire-compat-storage.js → esm2022/compat/storage/angular-fire-compat-storage.mjs} +0 -0
  415. /package/{esm2015/compat/storage/interfaces.js → esm2022/compat/storage/interfaces.mjs} +0 -0
  416. /package/{esm2015/compat/storage/observable/fromTask.js → esm2022/compat/storage/observable/fromTask.mjs} +0 -0
  417. /package/{esm2015/compat/storage/public_api.js → esm2022/compat/storage/public_api.mjs} +0 -0
  418. /package/{esm2015/compat/storage/ref.js → esm2022/compat/storage/ref.mjs} +0 -0
  419. /package/{esm2015/compat/storage/task.js → esm2022/compat/storage/task.mjs} +0 -0
  420. /package/{esm2015/database/angular-fire-database.js → esm2022/database/angular-fire-database.mjs} +0 -0
  421. /package/{esm2015/database/database.js → esm2022/database/database.mjs} +0 -0
  422. /package/{esm2015/database/firebase.js → esm2022/database/firebase.mjs} +0 -0
  423. /package/{esm2015/database/public_api.js → esm2022/database/public_api.mjs} +0 -0
  424. /package/{esm2015/database/rxfire.js → esm2022/database/rxfire.mjs} +0 -0
  425. /package/{esm2015/firestore/angular-fire-firestore.js → esm2022/firestore/angular-fire-firestore.mjs} +0 -0
  426. /package/{esm2015/firestore/firebase.js → esm2022/firestore/firebase.mjs} +0 -0
  427. /package/{esm2015/firestore/firestore.js → esm2022/firestore/firestore.mjs} +0 -0
  428. /package/{esm2015/firestore/lite/angular-fire-firestore-lite.js → esm2022/firestore/lite/angular-fire-firestore-lite.mjs} +0 -0
  429. /package/{esm2015/firestore/lite/firebase.js → esm2022/firestore/lite/firebase.mjs} +0 -0
  430. /package/{esm2015/firestore/lite/lite.js → esm2022/firestore/lite/lite.mjs} +0 -0
  431. /package/{esm2015/firestore/lite/public_api.js → esm2022/firestore/lite/public_api.mjs} +0 -0
  432. /package/{esm2015/firestore/lite/rxfire.js → esm2022/firestore/lite/rxfire.mjs} +0 -0
  433. /package/{esm2015/firestore/public_api.js → esm2022/firestore/public_api.mjs} +0 -0
  434. /package/{esm2015/functions/angular-fire-functions.js → esm2022/functions/angular-fire-functions.mjs} +0 -0
  435. /package/{esm2015/functions/firebase.js → esm2022/functions/firebase.mjs} +0 -0
  436. /package/{esm2015/functions/functions.js → esm2022/functions/functions.mjs} +0 -0
  437. /package/{esm2015/functions/public_api.js → esm2022/functions/public_api.mjs} +0 -0
  438. /package/{esm2015/functions/rxfire.js → esm2022/functions/rxfire.mjs} +0 -0
  439. /package/{esm2015/messaging/angular-fire-messaging.js → esm2022/messaging/angular-fire-messaging.mjs} +0 -0
  440. /package/{esm2015/messaging/firebase.js → esm2022/messaging/firebase.mjs} +0 -0
  441. /package/{esm2015/messaging/messaging.js → esm2022/messaging/messaging.mjs} +0 -0
  442. /package/{esm2015/messaging/public_api.js → esm2022/messaging/public_api.mjs} +0 -0
  443. /package/{esm2015/performance/angular-fire-performance.js → esm2022/performance/angular-fire-performance.mjs} +0 -0
  444. /package/{esm2015/performance/firebase.js → esm2022/performance/firebase.mjs} +0 -0
  445. /package/{esm2015/performance/performance.js → esm2022/performance/performance.mjs} +0 -0
  446. /package/{esm2015/performance/public_api.js → esm2022/performance/public_api.mjs} +0 -0
  447. /package/{esm2015/performance/rxfire.js → esm2022/performance/rxfire.mjs} +0 -0
  448. /package/{esm2015/public_api.js → esm2022/public_api.mjs} +0 -0
  449. /package/{esm2015/remote-config/angular-fire-remote-config.js → esm2022/remote-config/angular-fire-remote-config.mjs} +0 -0
  450. /package/{esm2015/remote-config/firebase.js → esm2022/remote-config/firebase.mjs} +0 -0
  451. /package/{esm2015/remote-config/public_api.js → esm2022/remote-config/public_api.mjs} +0 -0
  452. /package/{esm2015/remote-config/remote-config.js → esm2022/remote-config/remote-config.mjs} +0 -0
  453. /package/{esm2015/remote-config/rxfire.js → esm2022/remote-config/rxfire.mjs} +0 -0
  454. /package/{esm2015/storage/angular-fire-storage.js → esm2022/storage/angular-fire-storage.mjs} +0 -0
  455. /package/{esm2015/storage/firebase.js → esm2022/storage/firebase.mjs} +0 -0
  456. /package/{esm2015/storage/public_api.js → esm2022/storage/public_api.mjs} +0 -0
  457. /package/{esm2015/storage/rxfire.js → esm2022/storage/rxfire.mjs} +0 -0
  458. /package/{esm2015/storage/storage.js → esm2022/storage/storage.mjs} +0 -0
  459. /package/firestore/{angular-fire-firestore.d.ts → index.d.ts} +0 -0
  460. /package/firestore/lite/{angular-fire-firestore-lite.d.ts → index.d.ts} +0 -0
  461. /package/functions/{angular-fire-functions.d.ts → index.d.ts} +0 -0
  462. /package/{angular-fire.d.ts → index.d.ts} +0 -0
  463. /package/messaging/{angular-fire-messaging.d.ts → index.d.ts} +0 -0
  464. /package/performance/{angular-fire-performance.d.ts → index.d.ts} +0 -0
  465. /package/remote-config/{angular-fire-remote-config.d.ts → index.d.ts} +0 -0
  466. /package/storage/{angular-fire-storage.d.ts → index.d.ts} +0 -0
@@ -1,182 +0,0 @@
1
- # 2. Retrieving data as objects
2
-
3
- > **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).
4
-
5
- > The `AngularFireObject` is a service for manipulating and streaming object data.
6
-
7
- The `AngularFireObject` service is not created by itself, but through the `AngularFireDatabase` service.
8
-
9
- The guide below demonstrates how to retrieve, save, and remove data as objects.
10
-
11
- ## Injecting the `AngularFireDatabase` service
12
-
13
- **Make sure you have bootstrapped your application for AngularFire. See the Installation guide for bootstrap setup.**
14
-
15
- `AngularFireDatabase` is a service which can be injected through the constructor of your Angular component or `@Injectable()` service.
16
-
17
- If you've followed the earlier step "Installation and Setup" your `/src/app/app.component.ts` should look like below.
18
-
19
- ```ts
20
- import { Component } from '@angular/core';
21
- import { AngularFireDatabase } from '@angular/fire/compat/database';
22
- import { Observable } from 'rxjs';
23
-
24
- @Component({
25
- selector: 'app-root',
26
- templateUrl: 'app.component.html',
27
- styleUrls: ['app.component.css']
28
- })
29
- export class AppComponent {
30
- items: Observable<any[]>;
31
- constructor(db: AngularFireDatabase) {
32
- this.items = db.list('items').valueChanges();
33
- }
34
- }
35
- ```
36
-
37
- In this section, we're going to modify the `/src/app/app.component.ts` to retrieve data as object.
38
-
39
- ## Create an object binding
40
-
41
- ```ts
42
- const relative = db.object('item').valueChanges();
43
- ```
44
-
45
- ### Retrieve data
46
-
47
- To get the object in realtime, create an object binding as a property of your component or service.
48
-
49
- Then in your template, you can use the `async` pipe to unwrap the binding.
50
-
51
- ```ts
52
- import { Component } from '@angular/core';
53
- import { AngularFireDatabase } from '@angular/fire/compat/database';
54
- import { Observable } from 'rxjs';
55
-
56
- @Component({
57
- selector: 'app-root',
58
- template: `
59
- <h1>{{ (item | async)?.name }}</h1>
60
- `,
61
- })
62
- export class AppComponent {
63
- item: Observable<any>;
64
- constructor(db: AngularFireDatabase) {
65
- this.item = db.object('item').valueChanges();
66
- }
67
- }
68
- ```
69
-
70
- ## Saving data
71
-
72
- ### API Summary
73
-
74
- The table below highlights some of the common methods on the `AngularFireObject`.
75
-
76
- | method | |
77
- | ---------|--------------------|
78
- | `set(value: T)` | Replaces the current value in the database with the new value specified as the parameter. This is called a **destructive** update, because it deletes everything currently in place and saves the new value. |
79
- | `update(value: T)` | Updates the current value with in the database with the new value specified as the parameter. This is called a **non-destructive** update, because it only updates the values specified. |
80
- | `remove()` | Deletes all data present at that location. Same as calling `set(null)`. |
81
-
82
- ## Returning promises
83
-
84
- Each data operation method in the table above returns a promise. However,
85
- you should rarely need to use the completion promise to indicate success,
86
- because the realtime database keeps the object in sync.
87
-
88
- The promise can be useful to chain multiple operations, catching possible errors from security rules denials, or for debugging.
89
-
90
- ```ts
91
- const promise = db.object('item').remove();
92
- promise
93
- .then(_ => console.log('success'))
94
- .catch(err => console.log(err, 'You dont have access!'));
95
- ```
96
-
97
- ### Saving data
98
-
99
- Use the `set()` method for **destructive updates**.
100
-
101
- ```ts
102
- const itemRef = db.object('item');
103
- itemRef.set({ name: 'new name!'});
104
- ```
105
-
106
- ### Updating data
107
-
108
- Use the `update()` method for **non-destructive updates**.
109
-
110
- ```ts
111
- const itemRef = db.object('item');
112
- itemRef.update({ age: newAge });
113
- ```
114
-
115
- **Only objects are allowed for updates, not primitives**. This is because
116
- using an update with a primitive is the exact same as doing a `.set()` with a primitive.
117
-
118
- ### Deleting data
119
-
120
- Use the `remove()` method to remove data at the object's location.
121
-
122
- ```ts
123
- const itemRef = db.object('item');
124
- itemRef.remove();
125
- ```
126
-
127
- **Example app**:
128
-
129
- ```ts
130
- import { Component } from '@angular/core';
131
- import { AngularFireDatabase, AngularFireObject } from '@angular/fire/compat/database';
132
- import { Observable } from 'rxjs';
133
-
134
- @Component({
135
- selector: 'app-root',
136
- template: `
137
- <h1>{{ item | async | json }}</h1>
138
- <input type="text" #newname placeholder="Name" />
139
- <input type="text" #newsize placeholder="Size" />
140
- <br />
141
- <button (click)="save(newname.value)">Set Name</button>
142
- <button (click)="update(newsize.value)">Update Size</button>
143
- <button (click)="delete()">Delete</button>
144
- `,
145
- })
146
- export class AppComponent {
147
- itemRef: AngularFireObject<any>;
148
- item: Observable<any>;
149
- constructor(db: AngularFireDatabase) {
150
- this.itemRef = db.object('item');
151
- this.item = this.itemRef.valueChanges();
152
- }
153
- save(newName: string) {
154
- this.itemRef.set({ name: newName });
155
- }
156
- update(newSize: string) {
157
- this.itemRef.update({ size: newSize });
158
- }
159
- delete() {
160
- this.itemRef.remove();
161
- }
162
- }
163
- ```
164
-
165
- ## Retrieving the snapshot
166
-
167
- AngularFire `valueChanges()` unwraps the Firebase DataSnapshot by default, but you can get the data as the original snapshot by using the `snapshotChanges()` option.
168
-
169
- ```ts
170
- this.itemRef = db.object('item');
171
- this.itemRef.snapshotChanges().subscribe(action => {
172
- console.log(action.type);
173
- console.log(action.key)
174
- console.log(action.payload.val())
175
- });
176
- ```
177
-
178
- ## Querying?
179
-
180
- Because `AngularFireObject` synchronizes objects from the realtime database, sorting will have no effect for queries that are not also limited by a range. For example, when paginating you would provide a query with a sort and filter. Both the sort operation and the filter operation affect which subset of the data is returned by the query; however, because the resulting object is simply json, the sort order will not be preseved locally. Hence, for operations that require sorting, you are probably looking for a [list](lists.md)
181
-
182
- ### [Next Step: Retrieving data as lists](lists.md)
@@ -1,155 +0,0 @@
1
- # 4. Querying lists
2
-
3
- > **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).
4
-
5
- ## Creating a query with primitive/scalar values
6
-
7
- Queries are created by building on the [`firebase.database.Reference`](https://firebase.google.com/docs/reference/js/firebase.database.Reference).
8
-
9
- ```ts
10
- db.list('/items', ref => ref.orderByChild('size').equalTo('large'))
11
- ```
12
-
13
- ### Query options
14
-
15
- | Method | Purpose |
16
- | ---------|--------------------|
17
- | `orderByChild` | Specify a child to order by. |
18
- | `orderByKey` | Boolean to order by Firebase Database keys. |
19
- | `orderByValue` | Specify a value to order by. |
20
- | ~~`orderByPriority`~~<sup>1</sup> | Boolean to order by Firebase Database priority.|
21
- | `equalTo`<sup>2</sup> | Limit list to items that contain certain value. |
22
- | `limitToFirst` | Sets the maximum number of items to return from the beginning of the ordered list of results. |
23
- | `limitToLast` | Sets the maximum number of items to return from the end of the ordered list of results. |
24
- | `startAt`<sup>2</sup> | Return items greater than or equal to the specified key or value, depending on the order-by method chosen. |
25
- | `endAt`<sup>2</sup> | Return items less than or equal to the specified key or value, depending on the order-by method chosen. |
26
-
27
- <sup>1</sup> [This is the old way of doing things and is no longer recommended for use](https://youtu.be/3WTQZV5-roY?t=3m). Anything you can achieve with `orderByPriority` you should be doing with `orderByChild`.
28
-
29
- <sup>2</sup> The Firebase SDK supports an optional `key` parameter for [`startAt`](https://firebase.google.com/docs/reference/js/firebase.database.Reference#startAt), [`endAt`](https://firebase.google.com/docs/reference/js/firebase.database.Reference#endAt), and [`equalTo`](https://firebase.google.com/docs/reference/js/firebase.database.Reference#equalTo) when ordering by child, value, or priority. You can specify the `key` parameter using an object literal that contains the `value` and the `key`. For example: `startAt: { value: 'some-value', key: 'some-key' }`.
30
-
31
- To learn more about how sorting and ordering data works in Firebase, check out the Firebase documentation on [working with lists of data](https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data).
32
-
33
- ## Invalid query combinations
34
-
35
- **Queries can only be ordered by one method.** This means you can only specify
36
- `orderByChild`, `orderByKey`, `orderByPriority`, or `orderByValue`.
37
-
38
- ```ts
39
- // WARNING: Do not copy and paste. This will not work!
40
- ref.orderByChild('size').equalTo('large').orderByKey(true)
41
- ```
42
-
43
- You can only use `limitToFirst` or `limitToLast`, but not both in combination.
44
-
45
- ```ts
46
- // WARNING: Do not copy and paste. This will not work!
47
- ref.limitToFirst(10).limitToLast(100)
48
- ```
49
-
50
- ## Dynamic querying
51
-
52
- To enable dynamic queries one should lean on RxJS Operators like `switchMap`.
53
-
54
- An RxJS Subject is imported below. A Subject is like an Observable, but can multicast to many Observers. Subjects are like EventEmitters: they maintain a registry of many listeners. See, [What is a Subject](http://reactivex.io/rxjs/manual/overview.html#subject) for more information.
55
-
56
- When we call [`switchMap` on the Subject](https://www.learnrxjs.io/operators/transformation/switchmap.html), we can map each value to a new Observable; in this case a database query.
57
-
58
- ```ts
59
- const size$ = new Subject<string>();
60
- const queryObservable = size$.pipe(
61
- switchMap(size =>
62
- db.list('/items', ref => ref.orderByChild('size').equalTo(size)).valueChanges()
63
- )
64
- );
65
-
66
- // subscribe to changes
67
- queryObservable.subscribe(queriedItems => {
68
- console.log(queriedItems);
69
- });
70
-
71
- // trigger the query
72
- size$.next('large');
73
-
74
- // re-trigger the query!!!
75
- size$.next('small');
76
- ```
77
-
78
- **Example app:**
79
-
80
- [See this example in action on StackBlitz](https://stackblitz.com/edit/angularfire-db-api-s8ip7m).
81
-
82
- ```ts
83
- import { Component } from '@angular/core';
84
- import { AngularFireDatabase, AngularFireAction } from '@angular/fire/compat/database';
85
- import { Observable, Subscription, BehaviorSubject } from 'rxjs';
86
- import { switchMap } from 'rxjs/operators';
87
-
88
- @Component({
89
- selector: 'app-root',
90
- template: `
91
- <h1>Firebase widgets!</h1>
92
- <div *ngIf="items$ | async; let items; else loading">
93
- <ul>
94
- <li *ngFor="let item of items">
95
- {{ item.payload.val().text }}
96
- <code>{{ item.payload.key }}</code>
97
- </li>
98
- </ul>
99
- <div *ngIf="items.length === 0">No results, try clearing filters</div>
100
- </div>
101
- <ng-template #loading>Loading&hellip;</ng-template>
102
- <div>
103
- <h4>Filter by size</h4>
104
- <button (click)="filterBy('small')">Small</button>
105
- <button (click)="filterBy('medium')">Medium</button>
106
- <button (click)="filterBy('large')">Large</button>
107
- <button (click)="filterBy('x-large')">Extra Large</button>
108
- <button (click)="filterBy(null)" *ngIf="this.size$.getValue()">
109
- <em>clear filter</em>
110
- </button>
111
- </div>
112
- `,
113
- })
114
- export class AppComponent {
115
- items$: Observable<AngularFireAction<firebase.database.DataSnapshot>[]>;
116
- size$: BehaviorSubject<string|null>;
117
-
118
- constructor(db: AngularFireDatabase) {
119
- this.size$ = new BehaviorSubject(null);
120
- this.items$ = this.size$.pipe(
121
- switchMap(size =>
122
- db.list('/items', ref =>
123
- size ? ref.orderByChild('size').equalTo(size) : ref
124
- ).snapshotChanges()
125
- )
126
- );
127
- }
128
- filterBy(size: string|null) {
129
- this.size$.next(size);
130
- }
131
- }
132
- ```
133
-
134
- **To run the above example as is, you need to have sample data in you firebase database with the following structure:**
135
-
136
- ```json
137
- {
138
- "items": {
139
- "a" : {
140
- "size" : "small",
141
- "text" : "small thing"
142
- },
143
- "b" : {
144
- "size" : "medium",
145
- "text" : "medium sample"
146
- },
147
- "c" : {
148
- "size" : "large",
149
- "text" : "large widget"
150
- }
151
- }
152
- }
153
- ```
154
-
155
- ### [Next Step: Getting started with Firebase Authentication](../auth/getting-started.md)
@@ -1,257 +0,0 @@
1
- # AngularFireStorage
2
-
3
- > Cloud Storage is designed to help you quickly and easily store and serve user-generated content, such as photos and videos.
4
-
5
- > **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).
6
-
7
- ### Import the `NgModule`
8
-
9
- Cloud Storage for AngularFire is contained in the `@angular/fire/storage` module namespace. Import the `AngularFireStorageModule` in your `NgModule`. This sets up the `AngularFireStorage` service for dependency injection.
10
-
11
- ```ts
12
- import { BrowserModule } from '@angular/platform-browser';
13
- import { NgModule } from '@angular/core';
14
- import { AppComponent } from './app.component';
15
- import { AngularFireModule } from '@angular/fire/compat';
16
- import { AngularFireStorageModule } from '@angular/fire/compat/storage';
17
- import { environment } from '../environments/environment';
18
-
19
- @NgModule({
20
- imports: [
21
- BrowserModule,
22
- AngularFireModule.initializeApp(environment.firebase),
23
- AngularFireStorageModule
24
- ],
25
- declarations: [ AppComponent ],
26
- bootstrap: [ AppComponent ]
27
- })
28
- export class AppModule {}
29
- ```
30
-
31
- The `BUCKET` injection token can be used to customise the storage bucket.
32
-
33
- ```ts
34
- import {AngularFireStorageModule, BUCKET } from '@angular/fire/compat/storage';
35
-
36
- @NgModule({
37
- providers: [
38
- { provide: BUCKET, useValue: 'my-bucket-name' }
39
- ],
40
- ...
41
- })
42
- export class AppModule {}
43
- ```
44
-
45
- ### Injecting the AngularFireStorage service
46
-
47
- Once the `AngularFireStorageModule` is registered you can inject the `AngularFireStorage` service.
48
-
49
- ```ts
50
- import { Component } from '@angular/core';
51
- import { AngularFireStorage } from '@angular/fire/compat/storage';
52
-
53
- @Component({
54
- selector: 'app-component',
55
- template: ``
56
- })
57
- export class AppComponent {
58
- constructor(private storage: AngularFireStorage) { }
59
- }
60
- ```
61
-
62
- ### Uploading blobs
63
-
64
- There are three options for uploading files.
65
-
66
-
67
- | method | |
68
- | ---------|--------------------|
69
- | `put(data: Blob, metadata?: storage.UploadMetadata): AngularFireUploadTask` | Starts the upload of the blob to the storage reference's path. Returns an `AngularFireUploadTask` for upload monitoring. |
70
- | `putString(data: string, format?: StringFormat, metadata?: UploadMetadata): AngularFireUploadTask` | Updates an existing item in the array. Accepts a key, database reference, or an unwrapped snapshot. |
71
- | `upload(path: string, data: StringFormat, metadata?: UploadMetadata): AngularFireUploadTask` | Upload or update a new file to the storage reference's path. Returns an `AngularFireUploadTask` for upload monitoring. |
72
-
73
- ### Examples
74
-
75
- #### Uploading blobs with put
76
-
77
- ```ts
78
- import { Component } from '@angular/core';
79
- import { AngularFireStorage } from '@angular/fire/compat/storage';
80
-
81
- @Component({
82
- selector: 'app-root',
83
- template: `
84
- <input type="file" (change)="uploadFile($event)">
85
- `
86
- })
87
- export class AppComponent {
88
- constructor(private storage: AngularFireStorage) { }
89
- uploadFile(event) {
90
- const file = event.target.files[0];
91
- const filePath = 'name-your-file-path-here';
92
- const ref = this.storage.ref(filePath);
93
- const task = ref.put(file);
94
- }
95
- }
96
- ```
97
-
98
- #### Uploading blobs with putString
99
-
100
- ```ts
101
- import { Component } from '@angular/core';
102
- import { AngularFireStorage } from '@angular/fire/compat/storage';
103
-
104
- @Component({
105
- selector: 'app-root',
106
- template: `
107
- <input type="file" (change)="uploadFile($event)">
108
- `
109
- })
110
- export class AppComponent {
111
- constructor(private storage: AngularFireStorage) { }
112
- uploadFile(event) {
113
- const file = event.target.files[0];
114
- const filePath = 'name-your-file-path-here';
115
- const ref = this.storage.ref(filePath);
116
- const task = ref.putString(file);
117
- }
118
- }
119
- ```
120
-
121
- #### Uploading files with upload
122
-
123
- ```ts
124
- import { Component } from '@angular/core';
125
- import { AngularFireStorage } from '@angular/fire/compat/storage';
126
-
127
- @Component({
128
- selector: 'app-root',
129
- template: `
130
- <input type="file" (change)="uploadFile($event)">
131
- `
132
- })
133
- export class AppComponent {
134
- constructor(private storage: AngularFireStorage) { }
135
- uploadFile(event) {
136
- const file = event.target.files[0];
137
- const filePath = 'name-your-file-path-here';
138
- const task = this.storage.upload(filePath, file);
139
- }
140
- }
141
- ```
142
-
143
- ### Monitoring upload percentage
144
-
145
- An `AngularFireUploadTask` has methods for observing upload percentage as well as the final download URL.
146
-
147
- | method | |
148
- | ---------|--------------------|
149
- | `snapshotChanges(): Observable<FirebaseStorage.UploadTaskSnapshot>` | Emits the raw `UploadTaskSnapshot` as the file upload progresses. |
150
- | `percentageChanges(): Observable<number>` | Emits the upload completion percentage. |
151
- | `getDownloadURL(): Observable<any>` | Emits the download url when available |
152
-
153
- #### Example Usage
154
-
155
- The method `getDownloadURL()` doesn't rely on the task anymore, hence, in order to get the url we should use the finalize method from RxJS on top of the storage ref.
156
-
157
- ```ts
158
- import { finalize } from 'rxjs/operators';
159
-
160
- @Component({
161
- selector: 'app-root',
162
- template: `
163
- <input type="file" (change)="uploadFile($event)" />
164
- <div>{{ uploadPercent | async }}</div>
165
- <a [href]="downloadURL | async">{{ downloadURL | async }}</a>
166
- `
167
- })
168
- export class AppComponent {
169
- uploadPercent: Observable<number>;
170
- downloadURL: Observable<string>;
171
- constructor(private storage: AngularFireStorage) {}
172
- uploadFile(event) {
173
- const file = event.target.files[0];
174
- const filePath = 'name-your-file-path-here';
175
- const fileRef = this.storage.ref(filePath);
176
- const task = this.storage.upload(filePath, file);
177
-
178
- // observe percentage changes
179
- this.uploadPercent = task.percentageChanges();
180
- // get notified when the download URL is available
181
- task.snapshotChanges().pipe(
182
- finalize(() => this.downloadURL = fileRef.getDownloadURL() )
183
- )
184
- .subscribe()
185
- }
186
- }
187
- ```
188
-
189
- ### Downloading Files
190
-
191
- A convenient pipe exists for simple in page references.
192
-
193
- ```ts
194
- @Component({
195
- selector: 'app-root',
196
- template: `<img [src]="'users/davideast.jpg' | getDownloadURL" />`
197
- })
198
- export class AppComponent {}
199
- ```
200
-
201
- To download a file you'll need to create a reference and call the `getDownloadURL()` method on an `AngularFireStorageReference`.
202
-
203
- ```ts
204
- @Component({
205
- selector: 'app-root',
206
- template: `<img [src]="profileUrl | async" />`
207
- })
208
- export class AppComponent {
209
- profileUrl: Observable<string | null>;
210
- constructor(private storage: AngularFireStorage) {
211
- const ref = this.storage.ref('users/davideast.jpg');
212
- this.profileUrl = ref.getDownloadURL();
213
- }
214
- }
215
- ```
216
-
217
- ### Managing Metadata
218
-
219
- Cloud Storage for Firebase allows you to upload and download metadata associated with files. This is useful because you can store important metadata and download it without needing to download the entire file.
220
-
221
- ### Examples
222
-
223
- #### Downloading metadata
224
-
225
- ```ts
226
- @Component({
227
- selector: 'app-root',
228
- template: `<pre><code>{{ meta | async }}</code></pre>`
229
- })
230
- export class AppComponent {
231
- meta: Observable<any>;
232
- constructor(private storage: AngularFireStorage) {
233
- const ref = this.storage.ref('users/davideast.jpg');
234
- this.meta = ref.getMetadata();
235
- }
236
- }
237
- ```
238
-
239
- #### Uploading metadata with files
240
-
241
- ```ts
242
- @Component({
243
- selector: 'app-root',
244
- template: `
245
- <input type="file" (change)="uploadFile($event)" />
246
- `
247
- })
248
- export class AppComponent {
249
- constructor(private storage: AngularFireStorage) {}
250
- uploadFile(event) {
251
- const file = event.target.files[0];
252
- const filePath = 'name-your-file-path-here';
253
- const ref = this.storage.ref(filePath);
254
- const task = ref.put(file, { customMetadata: { blah: 'blah' } });
255
- }
256
- }
257
- ```
package/docs/compat.md DELETED
@@ -1,70 +0,0 @@
1
- # AngularFire
2
- The official [Angular](https://angular.io/) library for [Firebase](https://firebase.google.com/).
3
-
4
- <strong><pre>ng add @angular/fire</pre></strong>
5
-
6
- ## Compatibility Developer Guide
7
-
8
- AngularFire has a new tree-shakable API, you're looking at the documentation for the compatability version of the library. [Find the new developer guide here](../README.md#developer-guide).
9
-
10
- [See the v7 upgrade guide for more information on this change.](version-7-upgrade.md).
11
-
12
- ### Monitor usage of your application in production
13
-
14
- > `AngularFireAnalytics` provides a convenient method of interacting with Google Analytics in your Angular application. The provided `ScreenTrackingService` and `UserTrackingService` automatically log events when you're using the Angular Router or Firebase Authentication respectively. [Learn more about Google Analytics](https://firebase.google.com/docs/analytics).
15
-
16
- - [Getting started with Google Analytics](compat/analytics/getting-started.md)
17
-
18
- ### Interacting with your database(s)
19
-
20
- Firebase offers two cloud-based, client-accessible database solutions that support realtime data syncing. [Learn about the differences between them in the Firebase Documentation](https://firebase.google.com/docs/firestore/rtdb-vs-firestore).
21
-
22
- #### Cloud Firestore
23
-
24
- > `AngularFirestore` allows you to work with Cloud Firestore, the new flagship database for mobile app development. It improves on the successes of Realtime Database with a new, more intuitive data model. Cloud Firestore also features richer, faster queries and scales better than Realtime Database.
25
-
26
- - [Documents](compat/firestore/documents.md)
27
- - [Collections](compat/firestore/collections.md)
28
- - [Querying Collections](compat/firestore/querying-collections.md)
29
- - [Offline data](compat/firestore/offline-data.md)
30
-
31
- #### Realtime Database
32
-
33
- > `AngularFireDatabase` allows you to work with the Realtime Database, Firebase's original database. It's an efficient, low-latency solution for mobile apps that require synced states across clients in realtime.
34
-
35
- - [Objects](compat/rtdb/objects.md)
36
- - [Lists](compat/rtdb/lists.md)
37
- - [Querying lists](compat/rtdb/querying-lists.md)
38
-
39
- ### Authenticate users
40
-
41
- - [Getting started with Firebase Authentication](acompat/uth/getting-started.md)
42
- - [Route users with AngularFire guards](compat/auth/router-guards.md)
43
-
44
- ### Local Emulator Suite
45
-
46
- - [Getting started with Firebase Emulator Suite](compat/emulators/emulators.md)
47
-
48
- ### Upload files
49
-
50
- - [Getting started with Cloud Storage](compat/storage/storage.md)
51
-
52
- ### Receive push notifications
53
-
54
- - [Getting started with Firebase Messaging](compat/messaging/messaging.md)
55
-
56
- ### **BETA:** Change behavior and appearance of your application without deploying
57
-
58
- > Firebase Remote Config is a cloud service that lets you change the behavior and appearance of your app without requiring users to download an app update. [Learn more about Remote Config](https://firebase.google.com/docs/remote-config).
59
-
60
- - [Getting started with Remote Config](compat/remote-config/getting-started.md)
61
-
62
- ### Monitor your application performance in production
63
-
64
- > Firebase Performance Monitoring is a service that helps you to gain insight into the performance characteristics of your iOS, Android, and web apps. [Learn more about Performance Monitoring](https://firebase.google.com/docs/perf-mon).
65
-
66
- - [Getting started with Performance Monitoring](compat/performance/getting-started.md)
67
-
68
- ### Directly call Cloud Functions
69
-
70
- - [Getting started with Callable Functions](compat/functions/functions.md)