Title: Document properly how to use multiple Firebase projects in one app · Issue #1305 · angular/angularfire · GitHub
Open Graph Title: Document properly how to use multiple Firebase projects in one app · Issue #1305 · angular/angularfire
X Title: Document properly how to use multiple Firebase projects in one app · Issue #1305 · angular/angularfire
Description: There's a lenghty discussion about this in #1240, and one stackblitz example how to do it, thanks for that! The comments keep piling, so it seems this is still a source of frustration to people. The documentation should include examples ...
Open Graph Description: There's a lenghty discussion about this in #1240, and one stackblitz example how to do it, thanks for that! The comments keep piling, so it seems this is still a source of frustration to people. Th...
X Description: There's a lenghty discussion about this in #1240, and one stackblitz example how to do it, thanks for that! The comments keep piling, so it seems this is still a source of frustration to people...
Opengraph URL: https://github.com/angular/angularfire/issues/1305
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Document properly how to use multiple Firebase projects in one app","articleBody":"There's a lenghty discussion about this in #1240, and one stackblitz example how to do it, thanks for that!\r\n\r\nThe comments keep piling, so it seems this is still a source of frustration to people.\r\n\r\nThe documentation should include examples how to...\r\n\r\n- Configure 2 or more projects (for an example projects a, b and c)\r\n- inject realtime database or firestore pointing to project b to Angular **component**\r\n- inject realtime database or firestore pointing to project c to Angular **service** (annotated with `@Injectable()`)\r\n- inject two instances of realtime database or firestore pointing to project b **and** c configuration to Angular **component**\r\n- inject two instances of realtime database or firestore pointing to project b **and** c configuration to Angular **service** (annotated with `@Injectable()`)\r\n\r\nSo, essentially how to inject like this:\r\n```\r\nimport { Injectable } from '@angular/core'\r\nimport { AngularFireDatabase } from 'angularfire2/database'\r\n\r\n@Injectable()\r\nexport class MyService {\r\n\r\n constructor(\r\n private storeAppDb: AngularFireDatabase,\r\n private invoicingAppDb: AngularFireDatabase\r\n ) {\r\n }\r\n\r\n}\r\n```\r\n\r\nI don't think Angular supports injection scheme like that, but a blueprint how to achieve the same would be nice. (If I can choose which one to inject, then I can make two wrapper services, that I can inject..)\r\n\r\nIt would be nice though to be just able to say:\r\n```\r\nimport { Injectable } from '@angular/core'\r\n\r\n@Injectable()\r\nexport class MyService {\r\n\r\n constructor(\r\n private angularfire: AngularFire\r\n ) {\r\n const firestore1 = angularfire.firestore('conf1')\r\n const firestore2 = angularfire.firestore('conf2')\r\n }\r\n\r\n}\r\n```\r\nwhich would return the angularfireified firestore etc. services.\r\n","author":{"url":"https://github.com/swftvsn","@type":"Person","name":"swftvsn"},"datePublished":"2017-10-24T06:11:34Z","url":"https://github.com/angular/angularfire/issues/1305"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5fb21f58-6bec-b668-71d3-b172eb49d85a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8206:1F08:1E3B1EB:281EFB5:6B036015 |
| html-safe-nonce | 006a7dc2f0be19fdbea64d0cdf343bc7cfd24fb983aa9f7f95e0f24e3eb87a56 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MjA2OjFGMDg6MUUzQjFFQjoyODFFRkI1OjZCMDM2MDE1IiwidmlzaXRvcl9pZCI6IjEyMzQxODgxNjc0NTI3Nzg1MTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | fa615ac0d4ae0c53c6d9aa5dd558c388bcf5dc69b8eda282df57e8fc6c92294a |
| hovercard-subject-tag | issue:267908972 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angularfire/1305/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a5e4c7c02cbdcb1e2c89e787ffa70f448242f37b48eab1da26e5e81d2d46d793/angular/angularfire/issues/1305 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a5e4c7c02cbdcb1e2c89e787ffa70f448242f37b48eab1da26e5e81d2d46d793/angular/angularfire/issues/1305 |
| og:image:alt | There's a lenghty discussion about this in #1240, and one stackblitz example how to do it, thanks for that! The comments keep piling, so it seems this is still a source of frustration to people. Th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | swftvsn |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angularfire git https://github.com/angular/angularfire.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 49453413 |
| octolytics-dimension-repository_nwo | angular/angularfire |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49453413 |
| octolytics-dimension-repository_network_root_nwo | angular/angularfire |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width