-1

After Adding import { FormsModule } from '@angular/core'; to app.module.ts file
I'm getting

Uncaught Error: Unexpected value 'undefined' imported by the module 'AppModule'
        at syntaxError (compiler.js:2430)
        at compiler.js:18651
        at Array.forEach (<anonymous>)
        at CompileMetadataResolver.push../node_modules/@angular/compiler/fesm5/compiler.js.CompileMetadataResolver.getNgModuleMetadata (compiler.js:18620)
        at JitCompiler.push../node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler._loadModules (compiler.js:26029)
        at JitCompiler.push../node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler._compileModuleAndComponents (compiler.js:26010)
        at JitCompiler.push../node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler.compileModuleAsync (compiler.js:25970)
        at CompilerImpl.push../node_modules/@angular/platform-browser-dynamic/fesm5/platform-browser-dynamic.js.CompilerImpl.compileModuleAsync (platform-browser-dynamic.js:143)
        at compileNgModuleFactory__PRE_R3__ (core.js:17618)
        at PlatformRef.push../node_modules/@angular/core/fesm5/core.js.PlatformRef.bootstrapModule (core.js:17801) 

I request community to help me. I'm beginner in Angular-7

Til
  • 5,150
  • 13
  • 26
  • 34
Pavankumar AN
  • 55
  • 1
  • 12
  • Could you share more code? Where do you use `FormsModule`? – Scotty Waggoner Mar 19 '19 at 05:18
  • share your app module code – Sheik Althaf Mar 19 '19 at 05:28
  • import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/core'; import { AppComponent } from './app.component'; import { ProductComponent } from './products/products.component'; @NgModule({ declarations: [ AppComponent, BookComponent, ProductComponent, LowerPipe, DiscountPipe ], imports: [BrowserModule,FormsModule ], providers: [],bootstrap: [AppComponent] }) export class AppModule { } – Pavankumar AN Mar 19 '19 at 11:55
  • Hai here I shared my app.module.ts code – Pavankumar AN Mar 19 '19 at 11:56
  • I found my answer. It was mistake while importing. It is '@angular/forms' not '@angular/core' – Pavankumar AN Mar 21 '19 at 03:59

1 Answers1

2

try this

import { FormsModule } from '@angular/forms';
Patrick W
  • 1,485
  • 4
  • 19
  • 27
Mr Sindhu
  • 316
  • 2
  • 11