Angular4.X 报错: Can't bind to 'ngModel' since it isn't a known property of 'input'
来源:互联网 发布:上杉升 知乎 编辑:程序博客网 时间:2024/05/17 11:35
使用angular4时,应用angular指令,如ngModel时,发生如题的错误
原因: 未导入执行指令所需的文件
解决方法: 在app.module.ts文件中导入FormsModule文件,如下所示:
@NgModule({ declarations: [ AppComponent, Product1Component, Product2Component, ErrorComponent ], imports: [ BrowserModule, AppRoutingModule, FormsModule ], providers: [ ProductService, ], bootstrap: [AppComponent]})export class AppModule { }
阅读全文
0 0
- Angular4.X 报错: Can't bind to 'ngModel' since it isn't a known property of 'input'
- Angular: Can't bind to 'ngModel' since it isn't a known property of 'input'问题解决
- Angular: Can’t bind to ‘ngModel’ since it isn’t a known property of ‘input’
- angular--Can't bind to 'ngModel' since it isn't a known property of 'input'
- 【angular】ngModel遇见的坑:Can't bind to 'ngModel' since it isn't a known property of 'input'
- 错误 Angular2 Can't bind to 'routerLink' since it isn't a known property of 'a'
- Can't bind to 'formGroup' since it isn't a known property of 'form'. ("
- Template parse errors: Can't bind to 'placeholder' since it isn't a known property of 'select'
- storage size of 'a' isn't known
- andorid编译报错serve_image.c:32:18: error: storage size of ‘hints’ isn’t known
- storage size of ‘oldact’ isn’t known
- storage size of ‘XXX’ isn’t known
- 报错storage size of ‘act’ isn’t known当使用std=c99编译struct sigaction
- storage size of `seraddr' isn't known #include
- error: storage size of 'rq' isn't known 正解
- error storage size of 'pwbuf' isn't known
- error: storage size of ‘server_addr’ isn’t known
- error: storage size of ‘md_ctx’ isn’t known
- fragment 展示条目图片
- 第二周学习总结
- (转)终于把区块链的技术与应用讲清楚了ppt
- leetcode 11. Container With Most Water
- adb介绍以及常用命令
- Angular4.X 报错: Can't bind to 'ngModel' since it isn't a known property of 'input'
- java获取线程的返回值
- spring学习笔记叁——spring的bean注解
- POJ-3687 Labeling Balls
- IntelliJ IDEA 提交代码到 GitHub
- 智能指针
- 用户的浏览商品记录功能代码
- Python 爬虫实战案例 : 微信公众号的爬取
- android之自定义简单不平凡的对话框