You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched for existing issues that already report this problem, without success.
Ionic Framework Version
v4.x
v5.x
v6.x
Current Behavior
Correctly typed ion-contentionScroll event handler like in the following example fails to compile in production build when Angular strictTemplates are enabled in tsconfig.json (default behavior for new Angular v12 and v13 projects).
onContentScroll(scrollEvent: CustomEvent<ScrollDetail>){// some code}
Angular expects scrollEvent to be typed as Event, but it's actually CustomEvent.
Error:
Argument of type 'Event' is not assignable to parameter of type 'CustomEvent<ScrollDetail>'.
Type 'Event' is missing the following properties from type 'CustomEvent<ScrollDetail>': detail, initCustomEvent
Expected Behavior
Production build should succeed without any errors when Angular strictTemplates are enabled.
Steps to Reproduce
Enable Angular strictTemplates
Set correct typing for your ion-content scroll event argument (CustomEvent<ScrollDetail>)
Try to compile production build of your Angular app.
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Prerequisites
Ionic Framework Version
Current Behavior
Correctly typed
ion-content
ionScroll
event handler like in the following example fails to compile in production build when AngularstrictTemplates
are enabled intsconfig.json
(default behavior for new Angular v12 and v13 projects).Angular expects
scrollEvent
to be typed asEvent
, but it's actuallyCustomEvent
.Error:
Expected Behavior
Production build should succeed without any errors when Angular
strictTemplates
are enabled.Steps to Reproduce
strictTemplates
ion-content
scroll event argument (CustomEvent<ScrollDetail>
)Code Reproduction URL
No response
Ionic Info
Ionic CLI : 6.18.1
Ionic Framework : @ionic/angular 6.0.0
@angular-devkit/build-angular : 13.0.2
@angular-devkit/schematics : 13.0.2
@angular/cli : 13.0.2
@ionic/angular-toolkit : 5.0.4-testing.4
Capacitor:
Capacitor CLI : 3.3.1
@capacitor/android : not installed
@capacitor/core : 3.3.1
@capacitor/ios : not installed
Utility:
cordova-res : 0.15.3
native-run : 1.5.0
System:
NodeJS : v14.18.1
npm : 7.24.2
OS : Windows 10
Additional Information
No response
The text was updated successfully, but these errors were encountered: