我有一个使用 DCL 加载的组件。我想将控制组添加到父表单。我做了一个 plunker demo .我不知道如何将子控件组绑定(bind)到父控件。
add() {
this._dcl.loadIntoLocation(DynamicCmp, this._e, 'location').then((ref) => {
ref.instance._ref = ref;
ref.instance._idx = this.idx++;
this._children.push(ref);
});
}
这就是我添加组件的方式。有人请告诉我如何将子控件添加到父窗体的控件中
最佳答案
我认为您不能将任何内容传递给 DLC 组件,反之亦然。你可以做什么,我认为使用它是更方便的解决方案:
this.completeForm.addControl("sku", new Control)
看看 Plunker: http://plnkr.co/edit/MahOzQqkyv613N1NtElF?p=preview
关于typescript - 如何添加使用动态组件加载器创建的组件的表单值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34915965/