formGroup:错误

Can't bind to 'formGroup' since it isn't a known property of 'form'. ("

原因:

 

在使用form表单时,如果用到了form-group与formControlName,需要在app.module.ts中的import引入的不仅仅有FormsModule,还要引入ReactiveFormsModule。如果是懒加载,则按需在各自的module中引入

解决方案: 引入 还需要 ReactiveFormsModule

ANGULAR6.x - 错误随笔 - Can't bind to 'formGroup'

 

结果如图:

ANGULAR6.x - 错误随笔 - Can't bind to 'formGroup'

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-31
  • 2022-12-23
  • 2021-10-07
  • 2022-12-23
  • 2021-07-18
  • 2021-09-17
猜你喜欢
  • 2021-05-24
  • 2021-12-04
  • 2021-06-15
  • 2022-12-23
  • 2021-07-21
  • 2022-12-23
相关资源
相似解决方案