Seems like I'm facing a familiar issue. Trying to utilize Service1 in Service2, but encountering this exception:
Error: Can't resolve all parameters for ILIASRestProvider: (Http, ?).
Despite Service2 being injectable in other Components. I've made sure to have everything in place:
- @Injectable added to both Service1 and Service2
- tsconfig.json emitDecoratorMetadata set to true
- Service1 and Service2 registered in the Providers section of the ngModule
Just for context, I'm developing an Ionic 2 RC0 Application. Below are the key files:
app.module.ts
[Replaced with unique content]
ilias-rest.provider.ts
@Injectable()
export class ILIASRestProvider {
public constructor(private http:Http, public app:ConnectionService) {
}
...
}
ilias-app.service.ts
@Injectable()
export class ConnectionService {
...
constructor(public _config:AppConfig) {
this._database = SQLiteDatabaseService.instance();
}
...
}
app-config.ts
@Injectable()
export class AppConfig {
protected data:any = {};
constructor(public http:Http) {
}
...
}
ionic setup
Your system information:
Cordova CLI: 5.4.1
Ionic Framework Version: 2.0.0-rc.0
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
OS: Distributor ID: Ubuntu Description: Ubuntu 14.04.5 LTS
Node Version: v6.6.0