我有一个FormGroup,它将它的一些字段引用到另一个组件,该组件使它成为它的子级。但是,每当我在子进程的rendering阶段上时,都会收到这个错误 Error: formControlName must be used with a parent formGroup directiveYou'll want to add a formGroup... 当您在FormGroup外部的字段上包含formControlName属性时,这是一个一般性错误。我已经确保父</
将ChildComponent表单放置到父组件表单中的最佳方法是什么?我们正在使用最新的角8在2019年。下面的方法在研究后没有充分发挥作用。父组件: this.parentForm = this.fb.group({ })this.ChildFormChildComponent) childComponent: ChildComponent;
And now in ngAfterViewInit() we can ad
我看到表达式用下面的代码更改了错误,它在V11中工作得很好,但是在V14中失败。这是一个简单的代码,我在父组件中创建一个表单组,并将它传递给子组件,在那里我添加了一个表单控件(带有所需的验证器),这将使表单组无效。app.component.html:import {FormGroup} from "@angular/