尝试启动应用程序时出错:
Uncaught Error: Template parse errors:
Can't bind to 'ngModel' since it isn't a known property of 'md-select'.
1. If 'md-select' is an Angular component and it has 'ngModel' input, then verify that it is part of this module.
2. If 'md-select' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("
我不确定我是否理解问题。但我有导入:
import { BrowserModule } from '@angular/platform-browser';
import { ReactiveFormsModule, FormsModule } from '@angular/forms';
答案 0 :(得分:2)
您的应用中缺少FormsModule。
在app.module.ts中执行以下操作:
import { FormsModule } from '@angular/forms';
// ...
@NgModule({
imports: [
// Add FormsModule in your imports[]
FormsModule,
// ...
],