Angular - Can't bind to 'ngModel' since it isn't a known property of 'input'.

用[(ngModel)]="xxx"双向绑定,如:控制台报错:Can't bind to 'ngModel' since it isn't a known property of 'input'.

 

解决办法:在app.module.ts文件中导入FormsModule

 

 

posted @ 2017-07-19 22:16  AndreMao  阅读(311)  评论(0编辑  收藏  举报