I've encountered a problem with injecting services in angular 5 as in tutorial.
I have a simple service
@Injectable() export class SimpleService { ... } And a simple component:
@Component({...}) export class SimpleComponent { constructor(private simpleService SimpleService) {} } A service is set to providers in module:
@NgModule({ ... providers: [SimpleService] ... }) export class SimpleModule {} I see the following error in console:
Error: Can't resolve all parameters for SimpleComponent However, if I inject the SimpleService with @Inject like
@Inject(SimpleService) private simpleService: SimpleService the error disappears.
What am I doing wrong?
UPDATE: I saw several answers where people advise to add emitDecoratorMetadata: true to tsconfig file. But this line is already there