所以我要在这样的共享模块中导入和导出FormsModule:
@NgModule({
imports: [
FormsModule,
ReactiveFormsModule,
...
],
declarations: [],
exports: [
FormsModule,
ReactiveFormsModule,
...
]
})
我将SharedModule导入另一个模块,该模块在模板中具有执行此操作的组件:
<app-validation-errors [formControlInput]="formControlInput" [validationModel]="validationModel"></app-validation-errors>
ValidationErrorsComponent
@Input()
formControlInput: FormControl = new FormControl();
但是我收到此控制台错误:
Can't bind to 'formControlInput' since it isn't a known property of 'app-validation-errors'.
迷恋了一段时间,希望你们中的一个能帮助我。