Angular 2 : No NgModule metadata found

后端 未结 28 1499
盖世英雄少女心
盖世英雄少女心 2020-11-30 05:31

I\'m brand new to Angular 2 and attempting to follow along with a video tutorial I found. Despite following all of the steps, Angular just won\'t work; I get the following e

28条回答
  •  萌比男神i
    2020-11-30 05:46

    Late answer, but this might help someone. I got the same error, tried out all the previously mentioned suggestions, banged my head against the wall, but nothing worked.

    On careful observation, I noticed the following in app.module.ts:

    imports: [
      BrowserModule,
      BrowserAnimationsModule,
      FormsModule,
      HttpClientModule,, // Redundant comma 
      CoreModule
    ];
    

    So I banged my head some more. The extra comma, very innocently higlighted, by WebStorm, as a mild warning, wreaked havoc by inserting an empty slot in the Array. Watchout fot the elision trap ;)

提交回复
热议问题