Dynamic template “transclusion” in Angular2
问题 I am trying to achieve something like this: I have a model class called ObjectTypeA , ObjectTypeB and ObjectTypeC . There is also a factory ComponentFactory , which based on the type of object passed in will create different components: ComponentFactory.ts export interface ComponentFactoryInterface { static CreateComponent(obj: CommonSuperObject) } @Injectable() export class ComponentFactory { public static CreateComponent(obj: CommonSuperObject){ if (obj instanceof ObjectTypeA){ return