Please add a @Pipe/@Directive/@Component annotation. Error

后端 未结 11 2218
滥情空心
滥情空心 2021-02-06 21:29

I am stuck in a situation here. I am getting an error like this.

 compiler.es5.js:1694 Uncaught Error: Unexpected value \'LoginComponent\' declared by the modul         


        
11条回答
  •  有刺的猬
    2021-02-06 22:24

    Not a solution to the concrete example above, but there may be many reasons why you get this error message. I got it when I accidentally added a shared module to the module declarations list and not to imports.

    In app.module.ts:

    import { SharedModule } from './modules/shared/shared.module';
    
    @NgModule({
      declarations: [
         // Should not have been added here...
      ],
      imports: [
         SharedModule
      ],
    

提交回复
热议问题