Trying to use ComponentFactoryResolver to render a component view and insert it into the DOM, but encountering issues with undefined properties upon rendering. What steps can be taken to resolve this?
Specifically, the property in the component is defined as:
@Input('productId') productId;
When creating the view and passing data to the property, the following code is used:
const componentRef: any = this.componentFactoryResolver
.resolveComponentFactory(component)
.create(this.injector);
componentRef.instance.productId = data.productId;
However, when rendering in the template:
<div>{{ productId }}</div>
The productId is showing up as undefined.