Does anyone understand this snippet? - adding child to gridlayout dynamically


I am trying to add components into a gridlayout.

At the moment I am following

But it doesnt explain if I should be adding the child like this:

const factory = this.componentFactoryResolver.resolveComponentFactory(ProductButtonComponent);
const ref = this.gridcontainer.createComponent(factory);

Or I need to do in a different way?

Any help would be cool


Anyone be able to help me here?


Was Don Burgess able to help here?