Can’t bind to ‘ngModel’ since it isn’t a known property of

angular 使用 ngModel标签报错:

Can’t bind to ‘ngModel’ since it isn’t a known property of

 

解决:

在app.module.ts中引入FormsModule

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

并在NgModule的imports中引入 FormsModule

发表评论