I\'m trying to use \'providedin\' feature in Angular but receive the error \"StaticInjectorError(AppModule)[DashboardComponent -> DashboardService]:\"
@Injec
Finally I have found the solution: https://angular.io/guide/providers#providedin-and-ngmodules Service also should be mentioned in the providers section of module.
@NgModule({
imports: [CommonModule],
declarations: [DashboardComponent],
exports: [DashboardComponent],
providers: [DashboardService]
})
Demo has been corrected. Thank you guys!