So this is what happens when I use similar code:
EXCEPTION: No provider for NavController! (MyApp -> SomeService-> NavController)BrowserDomAdapter.logError @ app.bundle.js:32184
app.bundle.js:32184 STACKTRACE:BrowserDomAdapter.logError @ app.bundle.js:32184
app.bundle.js:32184 Error: DI Exception
at NoProviderError.BaseException as constructor
at NoProviderError.AbstractProviderError as constructor
at new NoProviderError (app.bundle.js:8572)
at Injector._throwOrNull (app.bundle.js:6894)
at Injector._getByKeyDefault (app.bundle.js:6945)
at Injector._getByKey (app.bundle.js:6885)
at Injector._getByDependency (app.bundle.js:6871)
at Injector._instantiate (app.bundle.js:6764)
at Injector._instantiateProvider (app.bundle.js:6754)
at Injector._new (app.bundle.js:6743)
The relevent code is:
@Injectable()
export class SomeService{
private _nav: NavController;
constructor(someFactory: SomeFactory, nav: NavController) {
this._someFactory= someFactory;
this._nav = nav;
}
This is being injected in the constructor for the top level application class (@App). When using the approach I suggested earlier, I have no problem whatsoever. What would you propose that I have done wrong to generate this problem?
note: For version control purpose we are developing with "ionic-framework": "2.0.0-alpha.53", "angular2": "2.0.0-beta.1",