Tuesday, 31 July 2018

Angular 6 providedin doesn't work -> StaticInjectorError

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

@Injectable({
  providedIn: DashboardModule
})
export class DashboardService {
  getContent() {
    return 'Dashboard Service works!!!';
  }
}

Full demo https://stackblitz.com/edit/angular-kbkjet Thanks for you effort!



from Angular 6 providedin doesn't work -> StaticInjectorError

No comments:

Post a Comment