有没有办法改变||为动态创建的组件设置模板?

时间:2017-11-10 20:39:55

标签: javascript angular

我正在动态创建组件:

let factory: ComponentFactory<any> = this.resolver.resolveComponentFactory(BBGridDynamicComponent);
  this.componentRef = this.target.createComponent(factory);
  const component = this.componentRef.instance;
  component.data= newData;

但是我需要一种方法来设置这个新的组件动态模板 有没有办法做到这一点?创建动态组件是否可以采用与动态模板相同的方式?例如,一个显示将在运行时定义的模板的基本组件。

0 个答案:

没有答案
相关问题