我正在尝试使用Angular js 2的Reactive Forms,我已经在我的组件中导入了Formcontrol和ReactiveFormsModule,但是我遇到了这个错误。 enter image description here
[Product.component.ts]
答案 0 :(得分:2)
这在技术上并不重复,因为在标记为重复的问题中,需要在ngModule
中标记FormsModule。但情况类似。您需要在ReactiveFormsModule
中标记ngModule
,而不是组件。
@NgModule({
imports: [ ReactiveFormsModule, ....],
// ....
})