-
遇到的问题:
angular2在双向数据绑定时[(ngModel)]无法使用,出现的错误是:
Can't bind to 'ngModel' since it isn't a known property of 'input'.
-
解决办法:
1.在app.model.ts中加入:
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
2.在imports中加入:
FormsModule
angular2在双向数据绑定时[(ngModel)]无法使用,出现的错误是:
Can't bind to 'ngModel' since it isn't a known property of 'input'.
1.在app.model.ts中加入:
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
2.在imports中加入:
FormsModule