Ionic Modal Lazy Loaded without routes - possible?


I have implemented modal views in Ionic5/Angular10, where the modalpage has its own module. (generated via ionic g page modals\MyModal. The calling component will import the modal module and the calling component the modalpage. The way it should be.

Interestingly I need to have routes attached to it (including reference in app-routing.module.ts) in order for the modal to work. Which according to many howto’s should not be necessary.

If I remove the routes - or more specifically, in app-routing.module.ts-, then suddenly the modal complaints at runtime about directives like *ngIf and async pipe not being available (part of CommonModule). The CommonModule is part of the imports in the modal module. So that shouldn’t be the issue.

I am pretty sure I am doing something wrong and I will keep it for now - until I am going to experiment on a different way.

But if someone has bumped into this or can explain why the modalpage needs to be part of the root level routing, in order to be using modules imported anyway (in its module definition), please shout out to me.

Regards and thanks,