Closed loneoakdev closed 8 months ago
I was importing ModalController from @ionic/angular/standalone like the rest of the Ionic objects in a standalone project. If you import it from @ionic/angular instead, it works fine. Hope this helps someone else though.
I'm having a problem getting standalone working. I'm using Angular v17.0.7, Ionic v7.6.1, and Ionic Selectable v5.0.3
I am not importing anything in my main.ts file. I'm importing IonicSelectableComponent in my standalone component. As soon as I access that component, I get the following error in the console:
NullInjectorError: R3InjectorError(Standalone[_AccountProfilePage])[ModalController -> ModalController -> ModalController -> ModalController]: NullInjectorError: No provider for ModalController!
I know Ionic Selectable uses the ModalController from Ionic to display the list of options. I tried adding ModalController to the providers array for the component which didn't work. I also tried importing IonicSelectableModalComponent in the imports array which also didn't work.
Any suggestions how to get around this error? Thanks.