Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error when passing a callback to onDidDismiss / onWillDismiss methods of overlay based components #15389

Closed
maxtacco opened this issue Aug 30, 2018 · 5 comments
Labels

Comments

@maxtacco
Copy link

Bug Report

Ionic Info
Run ionic info from a terminal/cmd prompt and paste the output below.

Ionic:

   ionic (Ionic CLI)          : 4.1.0 (/Users/max/.nvm/versions/node/v8.9.3/lib/node_modules/ionic)
   Ionic Framework            : @ionic/angular 4.0.0-beta.6
   @angular-devkit/core       : 0.7.3
   @angular-devkit/schematics : 0.7.3
   @angular/cli               : 6.1.3
   @ionic/ng-toolkit          : 1.0.7
   @ionic/schematics-angular  : 1.0.5

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : none
   Cordova Plugins       : no whitelisted plugins (0 plugins total)

System:

   Android SDK Tools : 26.1.1
   ios-deploy        : 1.9.2
   ios-sim           : 5.0.12
   NodeJS            : v8.9.3 (/Users/max/.nvm/versions/node/v8.9.3/bin/node)
   npm               : 6.4.0
   OS                : macOS High Sierra
   Xcode             : Xcode 9.4.1 Build version 9F2000

Environment:

   ANDROID_HOME : /Users/max/Library/Android/sdk

Describe the Bug
After update to 4.0.0-beta.6 code that uses overlay based components such as Modals and Alerts does not compile when a callback is passed to onDidDismiss or onWillDismiss methods.

The following error is displayed:
error TS2554: Expected 0 arguments, but got 1.

@ionitron-bot ionitron-bot bot added the triage label Aug 30, 2018
@bashoogzaad
Copy link

I also had this issue, solved it by using:

Change
.onDidDismiss((data) => {
to
.onDidDismiss().then((data) => {

The documentation lacks some information about this, but I can understand because its still in beta ;)

@maxtacco
Copy link
Author

maxtacco commented Aug 30, 2018

@bashoogzaad, thank you very much. I totally forgot they changed it to return Promises. Unfortunately, autocompletion in WebStorm doesn't work for Ion*Elements (#14784).

@bashoogzaad
Copy link

I understand, I have the same kind of 'struggles' in VSCode 😆

@netsesame2
Copy link

Just got it.

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 29, 2018

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.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants