ng: Can't bind to 'ngModel' since it isn't a known property of 'input'. - Angular 6
生活随笔
收集整理的這篇文章主要介紹了
ng: Can't bind to 'ngModel' since it isn't a known property of 'input'. - Angular 6
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
【出現的問題】ng: Can't bind to 'ngModel' since it isn't a known property of 'input'.
?
【解決方法】導入?FormsModule 到?app.module.ts (如下代碼粉色標記)
import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core';import { AppComponent } from './app.component'; import { OrderComponent } from './order/order.component'; import {FormControl, FormsModule} from '@angular/forms';@NgModule({declarations: [AppComponent,OrderComponent],imports: [BrowserModule,FormsModule],providers: [],bootstrap: [AppComponent] }) export class AppModule { }?
【參考】
https://stackoverflow.com/questions/38880150/angular-2-cant-bind-to-ngmodel-since-it-isnt-a-known-property-of-input
?
轉載于:https://www.cnblogs.com/coco1989/p/9377369.html
總結
以上是生活随笔為你收集整理的ng: Can't bind to 'ngModel' since it isn't a known property of 'input'. - Angular 6的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: php大马免杀技巧 | bypass w
- 下一篇: Centos 安装 jdk 和配置环境变