Title: AoT error with `@Inject` and global interface type · Issue #15640 · angular/angular · GitHub
Open Graph Title: AoT error with `@Inject` and global interface type · Issue #15640 · angular/angular
X Title: AoT error with `@Inject` and global interface type · Issue #15640 · angular/angular
Description: I'm submitting a ... (check one with "x") [x] bug report => search github for a similar issue or PR before submitting Current behavior Looks like the issue with interfaces from #12631 is still present. Ngc doesn't throw for user defined ...
Open Graph Description: I'm submitting a ... (check one with "x") [x] bug report => search github for a similar issue or PR before submitting Current behavior Looks like the issue with interfaces from #12631 is still pres...
X Description: I'm submitting a ... (check one with "x") [x] bug report => search github for a similar issue or PR before submitting Current behavior Looks like the issue with interfaces from #12...
Opengraph URL: https://github.com/angular/angular/issues/15640
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"AoT error with `@Inject` and global interface type","articleBody":"**I'm submitting a ...** (check one with \"x\")\r\n```\r\n[x] bug report => search github for a similar issue or PR before submitting\r\n```\r\n\r\n**Current behavior**\r\nLooks like the issue with interfaces from https://github.com/angular/angular/issues/12631 is still present. Ngc doesn't throw for user defined interfaces, but still throws for global interfaces from typescript such as `Window` or `Navigator`\r\n\r\n**Minimal reproduction of the problem with instructions**\r\n```\r\nimport {Component, Inject, NgModule, VERSION} from '@angular/core'\r\nimport {BrowserModule} from '@angular/platform-browser';\r\n\r\n@Component({\r\n selector: 'my-app',\r\n template: `\r\n \u003cdiv>\r\n \u003ch2>Hello {{name}}\u003c/h2>\r\n \u003c/div>\r\n `,\r\n})\r\nexport class App {\r\n name:string;\r\n constructor(@Inject('test') win: Window) {\r\n this.name = `Angular! v${VERSION.full}`\r\n }\r\n}\r\n\r\n@NgModule({\r\n imports: [ BrowserModule ],\r\n declarations: [ App ],\r\n bootstrap: [ App ],\r\n providers: [{provide: 'test', useValue: 'value'}]\r\n})\r\nexport class AppModule {}\r\n```\r\nts 2.2.1\r\n\r\nError:\r\n```\r\nFailed on type {\"filePath\":\"D:/Workspace/angular-/src/app/app.module.ts\",\"name\":\"App\",\"members\":[]} with error Error: Error encountered resolving symbol values statically. Could not resolv\r\ne type Window (position 14:36 in the original .ts file), resolving symbol App\r\n```\r\n\r\ncc @chuckjaz ","author":{"url":"https://github.com/DzmitryShylovich","@type":"Person","name":"DzmitryShylovich"},"datePublished":"2017-03-30T20:36:42Z","url":"https://github.com/angular/angular/issues/15640"}
| 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:01e92e44-7b78-4b6c-b46d-93f280d63a59 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EAC2:34DB8F:6AF332:90C28E:6B00DB06 |
| html-safe-nonce | 36c0dd0b8789a95eeee9e7023f62d4ade29101d167f066dcabb04de443ec4e84 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQUMyOjM0REI4Rjo2QUYzMzI6OTBDMjhFOjZCMDBEQjA2IiwidmlzaXRvcl9pZCI6IjI2MjcxMTU3MDQ0NDAxMTgwMjIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 89875191cbafc5377193a615485788a289f1869dced8dae9f95c466fdf3bab8d |
| hovercard-subject-tag | issue:218320367 |
| 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/15640/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8aff6128911f567147892174154620c00c657abe4d3090d982bf0ca36abcd23e/angular/angular/issues/15640 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8aff6128911f567147892174154620c00c657abe4d3090d982bf0ca36abcd23e/angular/angular/issues/15640 |
| og:image:alt | I'm submitting a ... (check one with "x") [x] bug report => search github for a similar issue or PR before submitting Current behavior Looks like the issue with interfaces from #12631 is still pres... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | DzmitryShylovich |
| hostname | github.com |
| expected-hostname | github.com |
| None | a481f62a1e04c9b9bdcb5628230682c66d59006f5b13b080f79cba84a176905b |
| 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 | 84c8c5cc25e2fb7f2308428458538436baecc6d2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width