I'm encountering an error in my angular 5 application ("@angular/core": "5.1.2") and need some assistance.
Uncaught Error: Can't resolve all parameters for FooComponent: (?).
Service:
@Injectable()
export class FooService { }
Component:
@Component({template: '<p></p>'})
export class FooComponent {
constructor(private s: FooService) { }
}
Module:
@NgModule({
declarations: [ AppComponent, FooComponent ],
bootstrap:[ AppComponent ],
providers: [ FooService ] })
export class AppModule {}
My tsconfig:
{
"compilerOptions": {
"baseUrl": "",
"declaration": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noImplicitAny": false,
"lib": [
"es6",
"dom"
],
"mapRoot": "./",
"module": "commonjs",
"moduleResolution": "node",
"rootDir": "./app",
"outDir": "../dist",
"sourceMap": true,
"target": "es5",
"noEmitOnError": true,
"typeRoots": [
"./node_modules/@types"
]
},
"include": [
"./**/*.ts"
]
}
I am unsure of what I might be missing here. I am using the es6
lib and it's worth noting that @Injectable
should not have any parameters. Do you have any insights or examples that could help me?
Could you provide guidance on how to debug DI in Angular in general?