I am having trouble injecting a service into another service in Angular 4.x and receive the error: Error: No provider for SkillsService!
I have created a repo that reproduces this error. You can run this locally by cloning the repo and simply running ng test from the repo root directory.
Steps i took...
- Create app with
ng new - Create ContactService with
ng g service contact - Create SkillsService with
ng g service skills - Add SkillsService to constructor of ContactService (with @Inject annotation)
- Add both SkillsService and ContactService to app.module.ts as providers
- Run
ng testand receive the error:Error: No provider for SkillsService!
How do I add a provider to ContactService for the SkillsService?
It seems like it must be something very simple, yet it's proving hard to work out from the documentation and searching around.