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

[v4-beta.6] slide.isEnd - Type ConstrainBooleanParameters is not assignable and misc function declaration #15376

Closed
peterpeterparker opened this issue Aug 29, 2018 · 2 comments
Labels

Comments

@peterpeterparker
Copy link
Contributor

peterpeterparker commented Aug 29, 2018

Ionic Info
Ionic/Angular v4-beta.6

Describe the Bug
I would report two problems related to slide.isEnd()

  1. When I try to get the result as boolean I get the following compilation error

      const end: boolean = await this.slides.isEnd();
    

[ng] ERROR in src/app/something/something.ts(84,9): error TS2322: Type 'boolean | ConstrainBooleanParameters' is not assignable to type 'boolean'.
[ng] Type 'ConstrainBooleanParameters' is not assignable to type 'boolean'.
[ng] ℹ 「wdm」: Failed to compile.

  1. Then I add a look to component.d.ts and noticed that isBeginning isn't declared as isEnd, I guess I should report it

     /**
     * Get whether or not the current slide is the first slide.
     */
     'isBeginning': () => Promise<boolean>;
     /**
     * Get whether or not the current slide is the last slide.
     */
     'isEnd': () => Promise<ConstrainBoolean>;
    

Related Code
See above

Expected Behavior
The ability to get the value

Workaround

const index: number = await this.slides.getActiveIndex();
const length: number = await this.slides.length();
const end: boolean = index === (length - 1);
@peterpeterparker
Copy link
Contributor Author

All good in v4.0.0-beta.7, thx

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 30, 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 30, 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

1 participant