error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class

后端 未结 25 2161
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-13 12:43

First time using firestore and I\'m getting this error. It seems to be a problem with Ivy, from my research. I don\'t have a lot of experience modifying tsconfig.app.json, w

25条回答
  •  青春惊慌失措
    2020-12-13 13:15

    I was adding service to module i.e. app.module.ts. I added it into imports array instead of providers array.

    @NgModule({
      imports: [
        MyService // wrong here
      ],
      providers: [
        MyService // should add here
      ]
    })
    export class AppModule { }
    

提交回复
热议问题