Giter VIP home page Giter VIP logo

Comments (5)

liamdebeasi avatar liamdebeasi commented on April 28, 2024 1

Ah I see, that makes sense. It looks like the @Method decorator was accidentally removed from getLength: 1d46973#diff-4b2ac275268173207c99a590b0ced8b67dc3d697815eb51a3c0546ee7cb0c0aeR429-L445

I'll put up a PR to fix this.

from ionic-framework.

liamdebeasi avatar liamdebeasi commented on April 28, 2024

Hey there,

Can you clarify the bug report? getLength is not a public API, so it should not be part of the public type interfaces.

from ionic-framework.

aeharding avatar aeharding commented on April 28, 2024

Sure! So I use this in in order to call public APIs, such as removeIndex. I use this to remove the previous navigation page from the stack. Without knowing how long the current stack is I am not sure how to call removeIndex.

A lot of the public APIs for ion-nav rely on index.

If there is a public API for determining the length of the stack in order to call removeIndex please let me know :)

A practical example is after a user has signed up, I want to remove previous intermediate signup pages from the stack (since the user should not be able to navigate back). Example code:

    nav.push(
      () => <Joined verifyEmailSent={verify_email_sent} />,
      null,
      null,
      async (hasCompleted, requiresTransition, entering) => {
        // Remove signup steps from stack (everything between root and current nav view)
        // (user should not be able to navigate back after signup)

        // TODO open bug for missing ionic type
        // eslint-disable-next-line @typescript-eslint/no-explicit-any
        if (entering) nav.removeIndex(1, (nav as any).getLength() - 2);
      },
    );

from ionic-framework.

liamdebeasi avatar liamdebeasi commented on April 28, 2024

Thanks for the issue. This has been resolved via #28832, and a fix will be available in an upcoming release of Ionic Framework. By marking getLength as a public method I also needed to make it return Promise<number> instead of number. Since this API was technically part of the public API (even though it's hard to use as-is right now), we are considering this a breaking change to minimize disruptions to existing apps. This fix will be available in the next major release of Ionic.

from ionic-framework.

ionitron-bot avatar ionitron-bot commented on April 28, 2024

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.

from ionic-framework.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.