Title: Angular 22 compatibility, EventData types are not correctly inferred from templates · Issue #170 · NativeScript/angular · GitHub
Open Graph Title: Angular 22 compatibility, EventData types are not correctly inferred from templates · Issue #170 · NativeScript/angular
X Title: Angular 22 compatibility, EventData types are not correctly inferred from templates · Issue #170 · NativeScript/angular
Description: Environment Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project): ✔ Component nativescript has 9.0.6 version and i...
Open Graph Description: Environment Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project): ✔ Compon...
X Description: Environment Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project): ✔ Compon...
Opengraph URL: https://github.com/NativeScript/angular/issues/170
X: @github
Domain: Github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Angular 22 compatibility, EventData types are not correctly inferred from templates","articleBody":"**Environment**\nProvide version numbers for the following components (information can be retrieved by running `tns info` in your project folder or by inspecting the `package.json` of the project):\n\n✔ Component nativescript has 9.0.6 version and is up to date.\n✔ Component @nativescript/core has 9.0.20 version and is up to date.\n✔ Component @nativescript/ios has 9.0.3 version and is up to date.\n✔ Component @nativescript/android has 9.0.4 version and is up to date.\n\n \"@angular/animations\": \"22.0.1\",\n\t\t\"@angular/common\": \"22.0.1\",\n\t\t\"@angular/compiler\": \"22.0.1\",\n\t\t\"@angular/core\": \"22.0.1\",\n\t\t\"@angular/forms\": \"22.0.1\",\n\t\t\"@angular/platform-browser\": \"22.0.1\",\n\t\t\"@angular/platform-browser-dynamic\": \"22.0.1\",\n\t\t\"@angular/router\": \"22.0.1\",\n \t\t\"@angular-devkit/build-angular\": \"22.0.1\",\n\t\t\"@angular/build\": \"22.0.1\",\n\t\t\"@ngtools/webpack\": \"22.0.1\",\n\t\t\"typescript\": \"6.0.3\",\n\t\t\"@nativescript/angular\": \"22.0.0-dev.0\",\n\t\t\"@nativescript/core\": \"9.0.20\",\n\t\t\"@nativescript/iqkeyboardmanager\": \"3.0.0\",\n\t\t\"@nativescript/localize\": \"5.2.0\",\n\t\t\"@nativescript/secure-storage\": \"4.0.1\",\n\t\t\"@nativescript/theme\": \"3.1.0\",\n\t\t\"rxjs\": \"7.8.2\",\n\t\t\"sass\": \"1.100.0\",\n\t\t\"typescript\": \"6.0.3\"\n**Describe the bug**\nWith the Angular 22 type checking I see 2 compatibility problems, both related to template checks. I need to say, my app is running perfectly fine. The problems I am seeing are from type checking only!\n\n1. this can be seen when activating \n\"angularCompilerOptions\": {\"strictDomEventTypes\": true}\n\nIt seems like angular cannot narrow down parameter types. I get about 400 errors related to the usage of $event in method calls. it is everywhere interpretet as Event rather than the related Nativescript EventData or derived type.. Below some examples to understand the pattern\n\nerror TS2345: Argument of type 'Event' is not assignable to parameter of type 'EventData'.\n Type 'Event' is missing the following properties from type 'EventData': eventName, object\n2 (shouldOverrideUrlLoading)=\"onOverrideUrlLoading($event)\" (loaded)=\"onPlayerLoaded($event)\" iosAllowInlineMediaPlayback=\"true\" backgroundColor=\"black\"\u003e\n\nERROR in src/app/modules/selection/pages/add-edit-meal/add-edit-meal.component.html:35:105 - error TS2345: Argument of type 'Event' is not assignable to parameter of type 'EventData'.\n Type 'Event' is missing the following properties from type 'EventData': eventName, object\n35 (textChange)=\"onCheckMealChange($event)\" class=\"text-field recipe-field\" (tap)=\"onTextFieldSetFocus($event)\"\u003e\n\n--------------------------------------\n\n2. Second problem can be seen when activating\n\"angularCompilerOptions\": {\"strictDomEventTypes\": false,}\n\"strictDomLocalRefTypes\": true,\n\nWhen I try to use a template reference in a function\n\u003cLabel #idElement (tap)=\"myFunction(idElement)\"\u003e\u003c/Label\u003e\nand want to use it in component as\npublic myFunction(arg:View){...}\n\nI get the error\nArgument of type 'HTMLElement' is not assignable to parameter of type 'View'.\n\n\n","author":{"url":"https://github.com/cjohn001","@type":"Person","name":"cjohn001"},"datePublished":"2026-06-13T15:50:37.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/170/angular/issues/170"}
| 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:1f61f58b-8f6c-c3f7-13e3-c4c8026e9bfa |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 94DE:12EAEE:391836:529556:6A636C7A |
| html-safe-nonce | 9b177c068f69b93347efb36f293704170ab8870755e08de5c98db5f4fbd74fa1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NERFOjEyRUFFRTozOTE4MzY6NTI5NTU2OjZBNjM2QzdBIiwidmlzaXRvcl9pZCI6IjgyMjY2MTA1MzI2ODg1NTUxMzAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 9858a1c6c551cb66902d78e03997229046275c83703b24e2af29a72b68fd8e59 |
| hovercard-subject-tag | issue:4656051490 |
| 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/NativeScript/angular/170/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9b60c78f957bfd0bea4aa7b34054b088a14cb701a435941742423293385419d1/NativeScript/angular/issues/170 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9b60c78f957bfd0bea4aa7b34054b088a14cb701a435941742423293385419d1/NativeScript/angular/issues/170 |
| og:image:alt | Environment Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project): ✔ Compon... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | cjohn001 |
| hostname | github.com |
| expected-hostname | github.com |
| None | e7b5617850fbcd6d10fe2b7c56398444bccb5f3a58a4a18c6d363971295bcd03 |
| turbo-cache-control | no-preview |
| go-import | github.com/NativeScript/angular git https://github.com/NativeScript/angular.git |
| octolytics-dimension-user_id | 7392261 |
| octolytics-dimension-user_login | NativeScript |
| octolytics-dimension-repository_id | 302428305 |
| octolytics-dimension-repository_nwo | NativeScript/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 302428305 |
| octolytics-dimension-repository_network_root_nwo | NativeScript/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 | aa341b3f432dc63fa9633042725aec601722a352 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width