Coder Social home page Coder Social logo

Comments (6)

liamdebeasi avatar liamdebeasi commented on May 1, 2024

Thanks for the issue. I am going to close this as this is not a bug in Ionic Framework. provideIonicAngular relies on the Angular standalone bundle of Ionic which does not use hydration. Your application is also loading code from the hydrated version of Ionic which is why it is expecting hydration to complete. As mentioned in the documentation, your application should not mix imports from @ionic/angular and @ionic/angular/standalone as they use 2 different build systems.

To fix this, your application should either use @ionic/angular (hydrated bundle) imports or @ionic/angular/standalone (standalone bundle) imports, but not both.

from ionic-framework.

dexster avatar dexster commented on May 1, 2024

@liamdebeasi I have fixed the repro to only use standalone and it still does not show anything when provided in the route provider. The issue may be different from the original hydration issue mentioned
https://stackblitz.com/edit/angular-pmvzjr?file=src%2Fmain.ts,src%2Fapp%2Fapp.component.ts,src%2Fapp%2Fexample.component.ts,src%2Fapp%2Fapp.component.html

from ionic-framework.

liamdebeasi avatar liamdebeasi commented on May 1, 2024

provideIonicAngular should be set on the root provider. It does not need to be provided individually to each component in the routing definition.

from ionic-framework.

dexster avatar dexster commented on May 1, 2024

My use-case is for micro-frontends where each remote is responsible for its own providers and the shell application should not have to add root providers for the remote applications in it.

from ionic-framework.

liamdebeasi avatar liamdebeasi commented on May 1, 2024

You'll want to make sure that the provideIonicAngular is added to the main.ts file in the remote application in that case. provideIonicAngular allows you to set a global config, so it needs to be set globally in the context of a single application.

I'm assuming here that the remote application is a complete Angular application instead of a single component.

from ionic-framework.

dexster avatar dexster commented on May 1, 2024

It is built as a complete Angular application, so it does have main.ts and root providers when running as a standalone app.

When it is integrated inside a host app as a micro-front-end remote, the remotes main.ts and root providers are bypassed and the host loads an entry point to the remote, which is the routes file containing the initial route the host must navigate to. This route needs to provide all the providers that the remote requires.

As a workaround, I am including the Ionic provider in the host app but this means that Ionic is loaded even if users do not navigate to the remote.

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.