angular - 无法绑定(bind)到 'FormGroup',因为它不是 'form' 的已知属性 ----

标签 angular typescript ionic-framework angular-forms

所以我一直在浏览互联网,每个人都说同样的话,那就是我必须在 appmodule.ts 中添加导入,但我已经添加了导入,但我仍然有同样的错误。

错误是:

Can't bind to 'FormGroup' since it isn't a known property of 'form'. ("
        <ion-col>

            <form novalidate [ERROR ->][FormGroup]="form" (ngSubmit)="addUser(form)">

                <ion-title class="center">Registr"): ng:///AppModule/RegisterPage.html@8:33

Register.html ( https://ghostbin.com/paste/8wn3q )

注册.ts ( https://ghostbin.com/paste/3sxcz )

Appmodule.ts ( https://ghostbin.com/paste/wgmxd )

最佳答案

看起来您正在使用 Ionic4?您还需要导入 FormsModuleReactiveFormsModule进入你的<page-name>.module.ts然后将它们添加到 imports数组。

关于angular - 无法绑定(bind)到 'FormGroup',因为它不是 'form' 的已知属性 ----,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52321691/

相关文章:

angular - Typescript 使用 filter() 过滤数组

javascript - Angular 5,平移管道不纯吗?

javascript - Ionic 和 Angularjs - 表单绑定(bind)似乎只是一种方式。

ios - ionic 应用程序 iOS 9 问题 [$rootScope :infdig] 10 $digest() iterations reached

forms - Angular 2 - 单击以编辑表单字段

typescript - 如何在angular2和 typescript 中初始化数组

用于除其他数组之外的任何数组的 typescript 接口(interface)

angular - 在 Angular2 *ngFor 迭代中,如何只输出数组中的唯一值?

angular - 第一次加载页面时,在 Angular Material 分页器中设置 pageIndex 不起作用

ios - ionic 1 ios 发布构建失败 Visual studio 2015