What is ComponentFactoryResolver used for?
A class that is used to create dynamic components - it produces a ComponentFactory for a particular component which can then be loaded into view via a createComponent on ViewContainerRef. Use ComponentFactoryResolver and ViewContainerRef to create the specific component needed and display it inside DetailsComponent.
const componentRef: any = this.componentFactoryResolver
.resolveComponentFactory(component)
.create(this.injector);
componentRef.instance.productId = data.productId;