找不到FormsModules Angular 5

时间:2018-05-30 09:09:53

标签: angular5

我正在尝试在angular 5 appmodule中导入FormsModules但是它给了我错误:找不到FromModule

import { BrowserModule } from '@angular/platform-browser';                
import { NgModule } from '@angular/core';                    
import { FormsModules } from '@angular/forms';                
import { ReactiveFormsModule }   from '@angular/forms';            
import { AppComponent } from './app.component';                    
import { TestComponent } from './test/test.component';        


@NgModule  ({


  declarations: [
    AppComponent,
    TestComponent

  ],


  imports: [
    BrowserModule,
    FormsModulesenter code here
  ],    

providers: [],

  bootstrap: [AppComponent]

})        

export class AppModule { }

1 个答案:

答案 0 :(得分:0)

您导入了错误的模块。请尝试以下代码

import { FormsModule }   from '@angular/forms'

@NgModule({
declarations: [
    AppComponent
],
imports: [
    BrowserModule,
    FormsModule
],
providers: [],
bootstrap: [AppComponent]
})

export class AppModule {
}

如需更多信息,请访问:https://angular.io/guide/forms