The createComponent() method returns a reference to the loaded component. Use that reference to interact with the component by assigning to its properties or calling its methods.
constcompRef=container.createComponent(compFactory);(compRef.instanceasLazyComponent).data='this is data';(compRef.instanceasLazyComponent).event.subscribe(v=>...);
how to pass inputs and catch outputs from this component.
Add input and output in component:-
In the service just add:-
Read more about dynamic components here: angular.io/guide/dynamic-component...