Title: Proposal: Optionally return a document ID on `valueChanges()` when reading a single document · Issue #2109 · angular/angularfire · GitHub
Open Graph Title: Proposal: Optionally return a document ID on `valueChanges()` when reading a single document · Issue #2109 · angular/angularfire
X Title: Proposal: Optionally return a document ID on `valueChanges()` when reading a single document · Issue #2109 · angular/angularfire
Description: Thanks to #1973 and #1976 (@codediodeio 🔥) the newest version of AngularFire allows to use valueChanges() in a way that it also maps the ID of the document to the document data that is being returned in addition to the document data itse...
Open Graph Description: Thanks to #1973 and #1976 (@codediodeio 🔥) the newest version of AngularFire allows to use valueChanges() in a way that it also maps the ID of the document to the document data that is being return...
X Description: Thanks to #1973 and #1976 (@codediodeio 🔥) the newest version of AngularFire allows to use valueChanges() in a way that it also maps the ID of the document to the document data that is being return...
Opengraph URL: https://github.com/angular/angularfire/issues/2109
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Proposal: Optionally return a document ID on `valueChanges()` when reading a single document","articleBody":"Thanks to #1973 and #1976 (@codediodeio 🔥) the newest version of AngularFire allows to use `valueChanges()` in a way that it also maps the ID of the document to the document data that is being returned in addition to the document data itself.\r\n\r\n```ts\r\nconst tasks: Observable\u003cTask[]\u003e = this.firestore.collection\u003cTask\u003e('tasks').valueChanges({ idField: 'id' });\r\n```\r\n\r\nThis currently only works when working with a `collection()` call.\r\n\r\nIt may also be nice to do the same when reading a single `doc()` like so:\r\n\r\n```ts\r\nconst taskId = 'abcdefg';\r\nconst task: Observable\u003cTask\u003e = this.firestore.doc\u003cTask\u003e(`tasks/${taskId}`).valueChanges({ idField: 'id' });\r\n```","author":{"url":"https://github.com/nickreynke","@type":"Person","name":"nickreynke"},"datePublished":"2019-06-12T13:59:00.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/2109/angularfire/issues/2109"}
| 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:14e6283d-e742-ffda-174a-f242964e7f6a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B4D4:38BA0C:203A00E:2EAC008:6A60B298 |
| html-safe-nonce | 254ef05b8189e447ad235d24d3135e85a1a1c0d709e84336c16527c8cfc96c8f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNEQ0OjM4QkEwQzoyMDNBMDBFOjJFQUMwMDg6NkE2MEIyOTgiLCJ2aXNpdG9yX2lkIjoiNzc2NTU2MjU2NTMxMDA2NzM1MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b7b6581ac104edfaa5f740e4cdbc05ee748fc2e6794be26a448860493d38b672 |
| hovercard-subject-tag | issue:455231023 |
| 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/2109/issue_layout |
| twitter:image | https://opengraph.githubassets.com/578daea893b5fc09aedceb909f156265004c1d3460c5d6a35cdb3495af81e2f3/angular/angularfire/issues/2109 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/578daea893b5fc09aedceb909f156265004c1d3460c5d6a35cdb3495af81e2f3/angular/angularfire/issues/2109 |
| og:image:alt | Thanks to #1973 and #1976 (@codediodeio 🔥) the newest version of AngularFire allows to use valueChanges() in a way that it also maps the ID of the document to the document data that is being return... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nickreynke |
| hostname | github.com |
| expected-hostname | github.com |
| None | 35671f8a6946a7a2a81d51ae49f5465bdc5f925c23c9cb839206b24345dbe8d9 |
| 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 | 746dc49090e6e3995bb502dce0f8807393e36eda |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width