I’m currently migrating my ionic 4 Project to v5. In some cases i create a Modal within a Service. With the styling for IOS13 Styled Modals i need to Inject the IonRouterOutler. Within a Service i can’t start the App:
Any Ideas, or did someone of the Team can explain how ti solve this? I think adding IonRouterOutler to Modules Providers isn’t the Solution, because i than have to add more and more too.
document.getElementById(‘ion-router-outlet-content’) works great when you only open one modal with presentingElement. However, it doesn’t work great when you open multiple modals with presentingElement (the UI gets messed up when closing the the second or top most modal). So I created the following method that can be use within a service but also throughout my application. Because getTop returns a promise you have to use async/await. You still need to add id=“ion-router-outlet-content” (to top level ion-app ion-router-outlet).