If I create a component, to be loaded by the modal-service, in a lazy-loaded route it can not be resolved with the error:
Error: No component factory found for CustomModalContentComponent. Did you add it to @NgModule.entryComponents? at noComponentFactoryError (core.es5.js?de3d:3202)
And this is since it is created in another context for the lazy loaded module.
So I pass along the
Injector from the component where I call the modal service, but that did not work as the ComponentResolveFactory for the current context is not used.
A fix would be to get the ComponentFactoryResolver from the passed injector.
84: const contentCmptFactory = contentInjector.get(ComponentFactoryResolver).resolveComponentFactory(content);
I have tried to edit the downloaded npm package and tried to create a pull-request, but could not get the tests to pass as it could not fond an instance of ComponentFactoryModule.
Version of Angular, ng-bootstrap, and Bootstrap: