如何添加它们使用动态组件加载器创建组件的形式价值? [英] How to add form values of a component which are created using dynamic component loader?

查看:111
本文介绍了如何添加它们使用动态组件加载器创建组件的形式价值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有它加载使用DCL的组件。我想补充的对照组母公司form.I已经取得了 plunker演示。我不知道如何给孩子对照组绑定到父。

I have a component which loads using DCL. I want to add the control group to parent form.I have made a plunker demo . I dont know how to bind the child control group to parent.

add() {
    this._dcl.loadIntoLocation(DynamicCmp, this._e, 'location').then((ref) => {
      ref.instance._ref = ref;
      ref.instance._idx = this.idx++;
      this._children.push(ref);
    });
}

这就是我如何加入components.Somebody请告诉我如何将子控件添加到父窗体

And this is how i am adding components.Somebody please tell me how to add the child controls to the control in parent form

推荐答案

我不认为你可以通过任何DLC组件,反之亦然。你可以做什么,我认为这是更加便利的解决方案是:

I don't think that you can pass anything to DLC component or vice versa. What you can do, and i think it is handier solution to use:

 this.completeForm.addControl("sku", new Control)

看Plunker:
http://plnkr.co/edit/MahOzQqkyv613N1NtElF?p=$p$pview

这篇关于如何添加它们使用动态组件加载器创建组件的形式价值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆