Template parse errors: Can't bind to 'ngModel' since it isn't a known property of &#

Posted z-ling

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Template parse errors: Can't bind to 'ngModel' since it isn't a known property of &#相关的知识,希望对你有一定的参考价值。

技术图片

该错误发生的原因是使用双向绑定[(ngModule)]时没引入FormsModule模块。

解决:

要在app.module.ts中引入FormsModule模块

import { FormsModule } from ‘@angular/forms‘;

在imports中导入 

 imports: [
    FormsModule
  ],

  

记住:使用双向绑定必须引入FormsModule模块。

以上是关于Template parse errors: Can't bind to 'ngModel' since it isn't a known property of &#的主要内容,如果未能解决你的问题,请参考以下文章

Template parse errors: Can't bind to 'ngModel' since it isn't a known property of &#

[vue/no-parsing-error] Parsing error: x-invalid-end-tag.eslint-plugin-vue

[vue/no-parsing-error] Parsing error: x-invalid-end-tag 提示报错

[vue/no-parsing-error] Parsing error: x-invalid-end-tag 提示报错

glibc: Parsing a Template String 如何解析printf格式化

Golang Template source code analysis(Parse)