Title: feat(template): support optional type annotations in @let declarations · Issue #66651 · angular/angular · GitHub
Open Graph Title: feat(template): support optional type annotations in @let declarations · Issue #66651 · angular/angular
X Title: feat(template): support optional type annotations in @let declarations · Issue #66651 · angular/angular
Description: Which @angular/* package(s) are relevant/related to the feature request? core Description Extend the @let template declaration syntax to support optional type annotations, similar to TypeScript variable declarations: @let myVar: MyType =...
Open Graph Description: Which @angular/* package(s) are relevant/related to the feature request? core Description Extend the @let template declaration syntax to support optional type annotations, similar to TypeScript var...
X Description: Which @angular/* package(s) are relevant/related to the feature request? core Description Extend the @let template declaration syntax to support optional type annotations, similar to TypeScript var...
Opengraph URL: https://github.com/angular/angular/issues/66651
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feat(template): support optional type annotations in @let declarations","articleBody":"### Which @angular/* package(s) are relevant/related to the feature request?\n\ncore\n\n### Description\n\nExtend the @let template declaration syntax to support optional type annotations, similar to TypeScript variable declarations:\n```ts\n@let myVar: MyType = myAny;\n```\nEg.:\n```ts\ntype MyType = { foo: boolean };\n\n@Component({\n selector: 'app-root',\n template: `\n @let myVar: MyType = myAny;\n\n {{ myVar.foo }}\n `,\n})\nexport class App {\n MyType!: MyType;\n myAny: any = { foo: true };\n}\n```\n\n### Proposed solution\n\n```ts\n@let myVar: MyType = myAny;\n```\n\n### Alternatives considered\n\n```ts\n@let myVar = myAny as MyType;\n```\n\nOR \n\nsome trick for declare type into template like JSDOC???\n\n```ts\ntype MyType = { foo: boolean };\n\n@Component({\n selector: 'app-root',\n template: `\n \u003c!-- @type { MyType } -->\n @let myVar = myAny;\n\n {{ myVar.foo }}\n `,\n})\nexport class App {\n MyType!: MyType;\n myAny: any = { foo: true };\n}\n```","author":{"url":"https://github.com/cesco69","@type":"Person","name":"cesco69"},"datePublished":"2026-01-20T15:26:04Z","url":"https://github.com/angular/angular/issues/66651"}
| 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:e8cacfba-c172-4d84-e097-3d8ccb82ed1a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AE2E:27D3AD:1974466:204B900:6B014555 |
| html-safe-nonce | bf13ce08a59a6bc242856b50ee4a885b8bcfc2d4f3510547e0ed1a2eea26ddb0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRTJFOjI3RDNBRDoxOTc0NDY2OjIwNEI5MDA6NkIwMTQ1NTUiLCJ2aXNpdG9yX2lkIjoiNDg3OTQ3MTI5MTE4ODQ2MjkzMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 71140e40e2ad5f69a94aa2f30ded87f4a260e27fa00724736a91d8eefa139b25 |
| hovercard-subject-tag | issue:3834221155 |
| 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/66651/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ed12d032350b4a1eb1c662ee7f8da63fcc92fc373ec3dad5f4b993b52194a46c/angular/angular/issues/66651 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ed12d032350b4a1eb1c662ee7f8da63fcc92fc373ec3dad5f4b993b52194a46c/angular/angular/issues/66651 |
| og:image:alt | Which @angular/* package(s) are relevant/related to the feature request? core Description Extend the @let template declaration syntax to support optional type annotations, similar to TypeScript var... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | cesco69 |
| 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