https://blog.csdn.net/h363659487/article/details/78619225
最初使用
[(ngModel)]
做双向绑定时,如果遇见Angular: Can‘t bind to ‘ngModel‘ since it isn‘t a known property of ‘input‘问题
解决办法:
在你的app.module中添加如下代码即可:
import { FormsModule, ReactiveFormsModule } from ‘@angular/forms‘;
@NgModule({
imports: [
FormsModule //此代码仅为需加入的部分,注意比对你本身的代码,把这个加入其中即可
]
Angular: Can't bind to 'ngModel' since it isn't a known property of 'input'问题解决
原文地址:https://www.cnblogs.com/tongbiao/p/8850100.html
时间: 2024-10-11 00:25:25