Title: Angular component which references its own type and decorated by class decorator is broken when target es2022 · Issue #49415 · angular/angular · GitHub
Open Graph Title: Angular component which references its own type and decorated by class decorator is broken when target es2022 · Issue #49415 · angular/angular
X Title: Angular component which references its own type and decorated by class decorator is broken when target es2022 · Issue #49415 · angular/angular
Description: Which @angular/* package(s) are the source of the bug? compiler Is this a regression? Yes Description Affected Package The issue is related to angular ivy compiler. Is this a regression? Yes, the exact use case works with es2020 value fo...
Open Graph Description: Which @angular/* package(s) are the source of the bug? compiler Is this a regression? Yes Description Affected Package The issue is related to angular ivy compiler. Is this a regression? Yes, the e...
X Description: Which @angular/* package(s) are the source of the bug? compiler Is this a regression? Yes Description Affected Package The issue is related to angular ivy compiler. Is this a regression? Yes, the e...
Opengraph URL: https://github.com/angular/angular/issues/49415
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Angular component which references its own type and decorated by class decorator is broken when target es2022","articleBody":"### Which @angular/* package(s) are the source of the bug?\n\ncompiler\n\n### Is this a regression?\n\nYes\n\n### Description\n\n### Affected Package\r\nThe issue is related to angular ivy compiler.\r\n### Is this a regression?\r\nYes, the exact use case works with es2020 value for compilerOptions/target in tsconfig.json.\r\n### Description\r\nGiven a normal angular component which references its own type in component metadata, and it's also decorated with an additional class decorator:` import { Component, InjectionToken, Input } from \"@angular/core\";\r\n\r\n```\r\nimport { Component, InjectionToken, Input } from \"@angular/core\";\r\n\r\nconst BOUND_COMPONENT = new InjectionToken\u003cany>(\"BoundComponent\");\r\n\r\nexport function Bind() {\r\n return function(target: any) {\r\n console.log(\"Bound\", target);\r\n };\r\n}\r\n\r\n@Bind()\r\n@Component({\r\n selector: \"hello\",\r\n template: `\r\n \u003ch1>Hello {{ name }}!\u003c/h1>\r\n `,\r\n providers: [{ provide: BOUND_COMPONENT, useExisting: HelloComponent }],\r\n styles: [\r\n `\r\n h1 {\r\n font-family: Lato;\r\n }\r\n `\r\n ]\r\n})\r\nexport class HelloComponent {\r\n @Input() name: string;\r\n}\r\n\r\nwill give an runtime error as you can see in stackblitz\r\n```\n\n### Please provide a link to a minimal reproduction of the bug\n\nhttps://stackblitz.com/edit/angular-ivy-69fw2s\n\n### Please provide the exception or error you saw\n\n```true\nError: NG0204: Token InjectionToken BoundComponent is missing a ɵprov definition.\n```\n\n\n### Please provide the environment you discovered this bug in (run `ng version`)\n\n```true\n_ _ ____ _ ___ \r\n / \\ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|\r\n / △ \\ | '_ \\ / _` | | | | |/ _` | '__| | | | | | | \r\n / ___ \\| | | | (_| | |_| | | (_| | | | |___| |___ | | \r\n /_/ \\_\\_| |_|\\__, |\\__,_|_|\\__,_|_| \\____|_____|___|\r\n |___/\r\n \r\n\r\nAngular CLI: 15.2.1\r\nNode: 18.13.0\r\nPackage Manager: npm 8.19.3\r\nOS: win32 x64\r\n\r\nAngular: 15.2.1\r\n... animations, cdk, cli, common, compiler, compiler-cli, core\r\n... forms, language-service, localize, material\r\n... material-moment-adapter, platform-browser\r\n... platform-browser-dynamic, router\r\n\r\nPackage Version\r\n---------------------------------------------------------\r\n@angular-devkit/architect 0.1502.1\r\n@angular-devkit/build-angular 15.2.1\r\n@angular-devkit/core 15.2.1\r\n@angular-devkit/schematics 15.2.1\r\n@schematics/angular 15.0.5\r\nng-packagr 15.2.2\r\nrxjs 7.8.0\r\ntypescript 4.8.4\n```\n\n\n### Anything else?\n\n_No response_","author":{"url":"https://github.com/zeljkoMarkovicFis","@type":"Person","name":"zeljkoMarkovicFis"},"datePublished":"2023-03-13T13:04:38Z","url":"https://github.com/angular/angular/issues/49415"}
| 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:ae74831d-2318-46a9-af62-409a3ef6fa62 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D076:7A60E:CDDFFD:10AAC56:6B00F3C2 |
| html-safe-nonce | 49e3527575a47c0dcac736e9fc1e2204335329e78565e58b169422566e20edf8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMDc2OjdBNjBFOkNEREZGRDoxMEFBQzU2OjZCMDBGM0MyIiwidmlzaXRvcl9pZCI6IjY0MzgwMTAxMjk5OTk3ODY5NDYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 81b5acd0ce454d8b1534f74ea597900e1a6d5a3b52bf1d6fc19beef58947b8a9 |
| hovercard-subject-tag | issue:1621449966 |
| 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/49415/issue_layout |
| twitter:image | https://opengraph.githubassets.com/30c59922a0e8192db2ca4335741295de5c4df2018dc6050da359e521c9f3bf18/angular/angular/issues/49415 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/30c59922a0e8192db2ca4335741295de5c4df2018dc6050da359e521c9f3bf18/angular/angular/issues/49415 |
| og:image:alt | Which @angular/* package(s) are the source of the bug? compiler Is this a regression? Yes Description Affected Package The issue is related to angular ivy compiler. Is this a regression? Yes, the e... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | zeljkoMarkovicFis |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc |
| 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 | 9983dd5da06943f833c971dd5b6bc988e2858be5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width