David Dal Busco
Jan 13, 2022

--

Hi Angel, thanks for the feedback! It’s been a while therefore I cannot give you a direct answer but I think the solution for parameters should not be implemented around the dynamic import() . I would suggest to have a look around the attachView to get a reference to the instance of the newly created component and assign the parameters. Something like:

this.componentRef = this.componentFactoryResolver
.resolveComponentFactory<T>(component)
.create(this.injector);
this.appRef.attachView(this.componentRef.hostView);
/** BEING: Pseudo code not tested */
componentRef.instance.message = message;
componentRef.instance.title = title;
/** END: Pseudo code not tested */
const domElem = (this.componentRef.hostView as
EmbeddedViewRef<any>)
.rootNodes[0] as HTMLElement;

Let me know what you will find, good luck 🤞

--

--

David Dal Busco
David Dal Busco

Written by David Dal Busco

Freelancer by day | Creator of Juno.build by night

No responses yet