简体   繁体   English

如何从指令访问 FormGroup - Thinbug

[英]How can I access FormGroup from Directive - Stack Overflow

在此处输入图像描述

I could already access the formControl of my form with Ngcontrol,我已经可以使用 Ngcontrol 访问我的表单的 formControl,

but I would like to access the formGroup of this control但我想访问这个控件的 formGroup

You should be able to access the form group like this: (formControl as FormControl).parent;您应该能够像这样访问表单组: (formControl as FormControl).parent;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM