shlomiassaf / ngx-modialog

Modal / Dialog for Angular
http://shlomiassaf.github.io/ngx-modialog
MIT License
686 stars 242 forks source link

SwapComponentDirective only finds Modal componentFactories in the Root Module #255

Open jvanharn opened 8 years ago

jvanharn commented 8 years ago

I have tried to fix it using "withComponents" and "forRoot" but they both did not fully resolve the issue, or in case of the last one, introduced side effects that were not ideal.

I have absolutely no idea how you could fix this, but if it is in fact unfixable, it may be a good idea to document it for simple souls like myself.

shlomiassaf commented 7 years ago

The problem is that you can't get the factory resolver in a later step, that's just how DI works.

SwapComponentDirective is just a temp component until the official angular component is out, I think it's already merged... just need to wait for the version.

Anyway, the solution is to allow sending the factory not the component, I don't know yet still an early concept.