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'
注:
博客:
https://blog.csdn.net/badao_liumang_qizhi
关注公众号
霸道的程序猿
获取编程相关电子书、教程推送与免费下载。
解决
这是因为在使用双向数据绑定[(ngModel)]时必须引入FormsModule这个模块。
打开app.module.ts
import { FormsModule } from '@angular/forms';
并添加声明
Angular中提示:Can't bind to 'ngModel' since it isn't a known property of 'input'相关推荐
- 【Angular 4】Can't bind to 'ngModel' since it isn't a known property of 'input'
问题描述 在双向数据绑定时[(ngModel)]无法使用,出现的错误是: Can't bind to 'ngModel' since it isn't a known property of 'inp ...
- ng: Can't bind to 'ngModel' since it isn't a known property of 'input'. - Angular 6
[出现的问题]ng: Can't bind to 'ngModel' since it isn't a known property of 'input'. [解决方法]导入 FormsModule ...
- 解决Angular里面报错:error NG8002: Can‘t bind to ‘ngModel‘ since it isn‘t a known property of ‘input‘.
以上是报错内容([(ngModel)]双向绑定失效) 解决办法:在module.ts中添加 import { FormsModule } from '@angular/forms';imports: ...
- Can't bind to 'ngModel' since it isn't a known property of 'pl-select'.
当新建模块,引用一个组件时,报错Can't bind to 'ngModel' since it isn't a known property of 'plx-select'. 解决: 查询官网文档可 ...
- Can‘t bind to formControl since it isn‘t a known property of input错误消息的处理
试图给input标签页施加formControl这个Directive的时候,出现如下错误: Can't bind to 'formControl' since it isn't a known pr ...
- html方法标签不起作用,Angular中innerHTML标签的样式不起作用的原因解析
1.背景 在最近angular的项目中,需要用到[innerHTML]标签来指定一个div的样式: //HTML部分 //TS部分 contents = ' 商品信息栏位商品信息介绍 '; 但是上面的 ...
- Can‘t bind to ‘ngForOf‘ since it isn‘t a known property of ‘xxx‘
今天遇到一个问题 提示Can't bind to 'ngForOf' since it isn't a known property of 'div' 检查了一下module配置发现是缺少了Commo ...
- 将选择元素绑定到Angular中的对象
本文翻译自:Binding select element to object in Angular I'd like to bind a select element to a list of obj ...
- 获取Angular中的AngularJS功能
介绍 ( Introduction ) If you have solid experience with AngularJS 1.x, you're well aware of the framew ...
最新文章
- djongo:Django和MongoDB连接器
- 小白如何购买阿里云服务器(图文教程)?
- iOS10 UI教程基础窗口的内容与设置起始窗口
- 小程序基于mpvue开发坑一
- Javascript的IE跟Firefox(火狐)兼容性-转
- java 返回空数组_避免在Java中检查Null语句
- 计算机进管理提示找不到入口,win10系统开机提示xxxdll模块已加载但找不到入口点的教程...
- Js双引号和单引号使用注意事项
- C语言性能优化书籍,Android应用性能优化 (埃尔韦) 中文PDF扫描版
- 选择WebSockets还是REST?
- 自制TXT文本分割工具
- Atitit.Atiposter 发帖机 信息发布器 v7 q516
- Centos 6.4 安装erlangrabbitmq
- 惠普bios硬重置_惠普BIOS密码重置工具下载_惠普重置BIOS下载 1.66 免费版_当载软件站...
- 初级软考程序员不会c语言,初级程序员考试就这么简单
- 编程设计模式中委托 和代理模式的区别
- 网红前端盼哥模拟面试总结
- CSS3+jquery实现图片万花筒3D旋转动画特效
- 合唱队形c语言编程,洛谷 P1091 合唱队形
- 手机长度px值_html长度尺寸单位px像素
热门文章
- oracle+restore+pfile,RAC(11gR2) OCR BACKUP RESTORE
- python合并文件_python把多个文件合并到一个新文件
- Java的自动装箱与自动拆箱
- 软件概要设计和详细设计的区别
- cmd52命令发送 mmc_Linux SD/MMC/SDIO驱动分析(新)
- pc工具不支持stb的加密方式_如何选择加密狗?九大标准
- oracle错误12518,ORA-12518: 错误 客户端连接不上
- arima模型 p q d 确定_时间序列分析第07讲(ARIMA模型,季节时间序列模型,均值的估计)...
- myeclipse mysql连接_MyEclipse连接MySQL数据库图文教程
- elasticsearch 条件去重_elasticsearch去重计数