使用【(ngModel)】时候报错:
1. core.js:1448 ERROR Error: Uncaught (in promise): Error: Template parse errors: Can't bind to 'ngModel' since it isn't a known property of 'input'.
解决: 在此compoent对应的model文件中
import { FormsModule } from '@angular/forms'; // <-- NgModel lives here
并在@NgModule 中的imports: 中添加FormsModule
2. ERROR Error: If ngModel is used within a form tag, either the name attribute must be set or the form control must be defined as 'standalone' in ngModelOptions。
解决: 在html文件对应的input框中添加unique name属性