Angular 6 providedin doesn't work -> StaticInjectorError

前端 未结 4 1034
梦毁少年i
梦毁少年i 2021-01-11 16:13

I\'m trying to use \'providedin\' feature in Angular but receive the error \"StaticInjectorError(AppModule)[DashboardComponent -> DashboardService]:\"

@Injec         


        
4条回答
  •  情书的邮戳
    2021-01-11 16:58

    Make sure you have your module imported in the test like this:

    beforeEach(() => TestBed.configureTestingModule({
      imports: [DashboardModule]
    }));
    

提交回复
热议问题