Having issues with providers and injections in Ionic 2 since version 2.0.0. Encountering the following error (with various providers, not just this one):
Uncaught Error: Can't resolve all parameters for LoginRedirectService: (App, ?, AlertController).
There seems to be an issue with resolving injections of providers, despite being decorated with @Injectable.
one file
@Injectable()
export class LoginRedirectService {
constructor(
public app:App,
//another provider, needed within this one - this cannot be resolved
public authService: AuthenticationService,
public alert:AlertController
)
//...
}
different file
@Injectable()
export class AuthenticationService {
constructor(public dataService:DataService){
//...
}
}
//...
and so forth.
All providers have been added in app.module.ts in the proper order:
//Ordered by dependencies, bottom is the most dependent on others
providers: [
HttpModule,
JsonpModule,
RssService,
EmergencyEmailService,
InAppBrowserService,
ExternalBrowser,
AppLauncherService,
LauncherPlaner,
LauncherSkype,
ConnectivityService,
MockRemoteDataService,
SoniaMirthRemoteDataService,
DataService,
AuthenticationService,
LoginRedirectService,
NewsStreamService,
SoniaBootstrapService
]
The project structure is as follows:
- src
- app
- app.module.ts
- app.component.ts
- assets
- pages
- providers
- sub-folders
- ...
- app
- package.json etc.
Attempted to explicitly call @Inject in the constructors of classes where they are required, without success.
In need of assistance, any help is appreciated. Thank you.