Title: feat(compiler): Support "in" operator in Angular templates · Issue #38560 · angular/angular · GitHub
Open Graph Title: feat(compiler): Support "in" operator in Angular templates · Issue #38560 · angular/angular
X Title: feat(compiler): Support "in" operator in Angular templates · Issue #38560 · angular/angular
Description: 🚀 feature request Description I'd like to have your opinions about supporting "in" operator in html templates. Let's say I have an object of a union type A | B. I'd like to use the 'in' operator to differentiate type. Something like: exp...
Open Graph Description: 🚀 feature request Description I'd like to have your opinions about supporting "in" operator in html templates. Let's say I have an object of a union type A | B. I'd like to use the 'in' operator to...
X Description: 🚀 feature request Description I'd like to have your opinions about supporting "in" operator in html templates. Let's say I have an object of a union type A | B. I'd like to us...
Opengraph URL: https://github.com/angular/angular/issues/38560
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feat(compiler): Support \"in\" operator in Angular templates","articleBody":"\u003c!--🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅\r\n\r\nOh hi there! 😄 \r\n\r\nTo expedite issue processing please search open and closed issues before submitting a new one.\r\nExisting issues often contain information about workarounds, resolution, or progress updates.\r\n\r\n🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅-->\r\n\r\n\r\n# 🚀 feature request\r\n\r\n### Description\r\nI'd like to have your opinions about supporting \"in\" operator in html templates. Let's say I have an object of a union type A | B. I'd like to use the 'in' operator to differentiate type.\r\nSomething like: \r\n\r\n```\r\nexport interface A {\r\n a: number\r\n}\r\n\r\nexport interface B {\r\n b: string\r\n}\r\n\r\nexport type MyUnionType = A | B;\r\n\r\nitem: MyUnionType = {\r\n a: 1\r\n }\r\n\r\n\u003cdiv *ngIf=\"'a' in item\">\r\n I'm expecting item is no longer of type A | B, but only A\r\n {{item.a}}\r\n\u003c/div>\r\n```\r\n\r\nHere is a [stackblitz](https://stackblitz.com/edit/ngifin?file=src/app/app.component.html)\r\n\r\n","author":{"url":"https://github.com/manueledones","@type":"Person","name":"manueledones"},"datePublished":"2020-08-24T08:42:29Z","url":"https://github.com/angular/angular/issues/38560"}
| 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:089728b2-de01-6f97-d158-20e54d62e459 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ACBA:2DBB21:1464C81:1B25D66:6B0130C8 |
| html-safe-nonce | 4f1428fc7bd0683a21088df20358a68660faf78d41b386c5f9f42ff7b2b913f5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQ0JBOjJEQkIyMToxNDY0QzgxOjFCMjVENjY6NkIwMTMwQzgiLCJ2aXNpdG9yX2lkIjoiNDQ1NTAxNDI5NzY4ODQyMDU1MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 529b76f244dafd11f4396d5d72e12467f1ce1a5b3f97c8f099d29170496f02ea |
| hovercard-subject-tag | issue:684482042 |
| 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/angular/38560/issue_layout |
| twitter:image | https://opengraph.githubassets.com/741af7dab3f764005419253bfe1a5d955e3a9681bce1fac9d166ecbd63dc0c1b/angular/angular/issues/38560 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/741af7dab3f764005419253bfe1a5d955e3a9681bce1fac9d166ecbd63dc0c1b/angular/angular/issues/38560 |
| og:image:alt | 🚀 feature request Description I'd like to have your opinions about supporting "in" operator in html templates. Let's say I have an object of a union type A | B. I'd like to use the 'in' operator to... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | manueledones |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width