【发布时间】:2018-10-29 22:45:39
【问题描述】:
我有一个使用 ComponentFactoryResolver 动态创建的组件
this.container.clear();
let factory = this.resolver.resolveComponentFactory(DynamicComponent);
this.componentRef = this.container.createComponent(factory);
template: '...<child-component [param1]="param1"></child-component>...';
问题是 DynamicComponent 的模板有子组件和输入绑定。动态创建组件时有没有办法给子组件传参数?
【问题讨论】: