Topic: [6.1.2] Toast Module: Cannot instantiate cyclic dependency
SteelLiras
asked 7 years ago
SteelLiras
answered 7 years ago
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Resolved
- User: Free
- Premium support: No
- Technology: MDB Angular
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No
Damian Gemza staff commented 7 years ago
Dear Jarek, Could you try to add to your core.module.ts also MDBBootstrapModulesPro.forRoot() import? Or if this won't work, could you please temporarily add ToastModule and MDBBootstrapModulesPro to app.module.ts and check if it works? Best Regards, DamianSteelLiras commented 7 years ago
It works when I have both imports in the App module and I use the Toast service in app.component. Once I move at least one of them into Core or Shared, I get the cyclic dependency error. Btw, this is a Universal project, turning off ServerTransition and HttpTransferModule changes nothing. I have lazy-loaded modules which import the Shared module. The core module imports the Shared module too (but it doesn't fix it when I remove Shared from Core's imports). The App module imports the Browser and Core module.